@aitlabs/namkwong 0.0.115 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-price/user/router.d.ts +13 -1
- package/dist/asset-type/admin/router.d.ts +1 -13
- package/dist/binary-option/user/dto.schemas.d.ts +2 -0
- package/dist/binary-option/user/router.d.ts +2 -0
- package/dist/index.d.ts +340 -0
- package/dist/market-data/internal/service.d.ts +19 -0
- package/dist/market-data/ws/index.d.ts +362 -0
- package/dist/market-data/ws/publisher.d.ts +14 -0
- package/dist/market-data/ws/schema.v.d.ts +262 -0
- package/dist/market-data/ws/utils.d.ts +18 -0
- package/dist/market-pricing/admin/router.d.ts +1 -13
- package/dist/news/admin/router.d.ts +13 -1
- package/dist/user-security/user/router.d.ts +1 -13
- package/package.json +1 -1
|
@@ -35,7 +35,19 @@ export declare const assetPriceRouter: Elysia<"/asset_prices", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
38
|
+
cookie?: Record<string, {
|
|
39
|
+
domain?: string | undefined;
|
|
40
|
+
expires?: Date | undefined;
|
|
41
|
+
httpOnly?: boolean | undefined;
|
|
42
|
+
maxAge?: number | undefined;
|
|
43
|
+
path?: string | undefined;
|
|
44
|
+
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
+
partitioned?: boolean | undefined;
|
|
46
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
+
secure?: boolean | undefined;
|
|
48
|
+
secrets?: string | null | (string | null)[];
|
|
49
|
+
value?: unknown;
|
|
50
|
+
}>;
|
|
39
51
|
};
|
|
40
52
|
path: string;
|
|
41
53
|
route: string;
|
|
@@ -35,19 +35,7 @@ export declare const assetTypeAdminRouter: Elysia<"/asset_types", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
39
|
-
domain?: string | undefined;
|
|
40
|
-
expires?: Date | undefined;
|
|
41
|
-
httpOnly?: boolean | undefined;
|
|
42
|
-
maxAge?: number | undefined;
|
|
43
|
-
path?: string | undefined;
|
|
44
|
-
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
-
partitioned?: boolean | undefined;
|
|
46
|
-
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
-
secure?: boolean | undefined;
|
|
48
|
-
secrets?: string | null | (string | null)[];
|
|
49
|
-
value?: unknown;
|
|
50
|
-
}>;
|
|
38
|
+
cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
|
|
51
39
|
};
|
|
52
40
|
path: string;
|
|
53
41
|
route: string;
|
|
@@ -195,6 +195,7 @@ export declare const binaryOptionUserMarketItemSchema: import("@sinclair/typebox
|
|
|
195
195
|
effectiveAt: import("@sinclair/typebox").TDate;
|
|
196
196
|
}>, import("@sinclair/typebox").TNull]>;
|
|
197
197
|
dailyChangeRate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
198
|
+
minuteChangeRate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
198
199
|
trend10d: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
199
200
|
date: import("@sinclair/typebox").TString;
|
|
200
201
|
price: import("@sinclair/typebox").TString;
|
|
@@ -433,6 +434,7 @@ export declare const binaryOptionUserMarketListResponseSchema: import("@sinclair
|
|
|
433
434
|
effectiveAt: import("@sinclair/typebox").TDate;
|
|
434
435
|
}>, import("@sinclair/typebox").TNull]>;
|
|
435
436
|
dailyChangeRate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
437
|
+
minuteChangeRate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
436
438
|
trend10d: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
437
439
|
date: import("@sinclair/typebox").TString;
|
|
438
440
|
price: import("@sinclair/typebox").TString;
|
|
@@ -434,6 +434,7 @@ export declare const binaryOptionRouter: Elysia<"/binary_option", {
|
|
|
434
434
|
effectiveAt: Date;
|
|
435
435
|
} | null;
|
|
436
436
|
dailyChangeRate: string | null;
|
|
437
|
+
minuteChangeRate: string | null;
|
|
437
438
|
trend10d: {
|
|
438
439
|
date: string;
|
|
439
440
|
price: string;
|
|
@@ -540,6 +541,7 @@ export declare const binaryOptionRouter: Elysia<"/binary_option", {
|
|
|
540
541
|
effectiveAt: Date;
|
|
541
542
|
} | null;
|
|
542
543
|
dailyChangeRate: string | null;
|
|
544
|
+
minuteChangeRate: string | null;
|
|
543
545
|
trend10d: {
|
|
544
546
|
date: string;
|
|
545
547
|
price: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,106 @@ declare const app: Elysia<"/api", {
|
|
|
13
13
|
} & {
|
|
14
14
|
typebox: {};
|
|
15
15
|
error: {};
|
|
16
|
+
} & {
|
|
17
|
+
typebox: {
|
|
18
|
+
readonly clientMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
19
|
+
action: import("@sinclair/typebox").TLiteral<"subscribe">;
|
|
20
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
21
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
22
|
+
symbol: import("@sinclair/typebox").TString;
|
|
23
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
|
+
}>>;
|
|
25
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
26
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
27
|
+
action: import("@sinclair/typebox").TLiteral<"unsubscribe">;
|
|
28
|
+
channels: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
29
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
30
|
+
symbol: import("@sinclair/typebox").TString;
|
|
31
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
+
}>>>;
|
|
33
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
34
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
35
|
+
action: import("@sinclair/typebox").TLiteral<"ping">;
|
|
36
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
|
+
}>]>;
|
|
38
|
+
readonly serverMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
39
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"subscribed">, import("@sinclair/typebox").TLiteral<"unsubscribed">]>;
|
|
40
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
41
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
42
|
+
symbol: import("@sinclair/typebox").TString;
|
|
43
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
44
|
+
}>>;
|
|
45
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
46
|
+
errors: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
47
|
+
channel: import("@sinclair/typebox").TObject<{
|
|
48
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
49
|
+
symbol: import("@sinclair/typebox").TString;
|
|
50
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
51
|
+
}>;
|
|
52
|
+
reason: import("@sinclair/typebox").TString;
|
|
53
|
+
}>>>;
|
|
54
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
55
|
+
type: import("@sinclair/typebox").TLiteral<"error">;
|
|
56
|
+
message: import("@sinclair/typebox").TString;
|
|
57
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
58
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
59
|
+
type: import("@sinclair/typebox").TLiteral<"pong">;
|
|
60
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
61
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
62
|
+
channel: import("@sinclair/typebox").TLiteral<"trades">;
|
|
63
|
+
symbol: import("@sinclair/typebox").TString;
|
|
64
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
65
|
+
price: import("@sinclair/typebox").TString;
|
|
66
|
+
size: import("@sinclair/typebox").TString;
|
|
67
|
+
side: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"buy">, import("@sinclair/typebox").TLiteral<"sell">]>;
|
|
68
|
+
tradeId: import("@sinclair/typebox").TString;
|
|
69
|
+
matchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
71
|
+
channel: import("@sinclair/typebox").TLiteral<"depth">;
|
|
72
|
+
symbol: import("@sinclair/typebox").TString;
|
|
73
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
74
|
+
bids: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
75
|
+
price: import("@sinclair/typebox").TString;
|
|
76
|
+
size: import("@sinclair/typebox").TString;
|
|
77
|
+
}>>;
|
|
78
|
+
asks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
79
|
+
price: import("@sinclair/typebox").TString;
|
|
80
|
+
size: import("@sinclair/typebox").TString;
|
|
81
|
+
}>>;
|
|
82
|
+
seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
83
|
+
isSnapshot: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
84
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
85
|
+
channel: import("@sinclair/typebox").TLiteral<"ticker">;
|
|
86
|
+
symbol: import("@sinclair/typebox").TString;
|
|
87
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
88
|
+
open: import("@sinclair/typebox").TString;
|
|
89
|
+
high: import("@sinclair/typebox").TString;
|
|
90
|
+
low: import("@sinclair/typebox").TString;
|
|
91
|
+
close: import("@sinclair/typebox").TString;
|
|
92
|
+
baseVolume: import("@sinclair/typebox").TString;
|
|
93
|
+
quoteVolume: import("@sinclair/typebox").TString;
|
|
94
|
+
change: import("@sinclair/typebox").TString;
|
|
95
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
96
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
97
|
+
channel: import("@sinclair/typebox").TLiteral<"price">;
|
|
98
|
+
symbol: import("@sinclair/typebox").TString;
|
|
99
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
100
|
+
price: import("@sinclair/typebox").TString;
|
|
101
|
+
source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
102
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
103
|
+
channel: import("@sinclair/typebox").TLiteral<"bar">;
|
|
104
|
+
symbol: import("@sinclair/typebox").TString;
|
|
105
|
+
resolution: import("@sinclair/typebox").TString;
|
|
106
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
107
|
+
open: import("@sinclair/typebox").TString;
|
|
108
|
+
high: import("@sinclair/typebox").TString;
|
|
109
|
+
low: import("@sinclair/typebox").TString;
|
|
110
|
+
close: import("@sinclair/typebox").TString;
|
|
111
|
+
volume: import("@sinclair/typebox").TString;
|
|
112
|
+
isFinal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
113
|
+
}>]>;
|
|
114
|
+
};
|
|
115
|
+
error: {};
|
|
16
116
|
}, {
|
|
17
117
|
schema: {};
|
|
18
118
|
standaloneSchema: {};
|
|
@@ -16112,6 +16212,7 @@ declare const app: Elysia<"/api", {
|
|
|
16112
16212
|
effectiveAt: Date;
|
|
16113
16213
|
} | null;
|
|
16114
16214
|
dailyChangeRate: string | null;
|
|
16215
|
+
minuteChangeRate: string | null;
|
|
16115
16216
|
trend10d: {
|
|
16116
16217
|
date: string;
|
|
16117
16218
|
price: string;
|
|
@@ -16218,6 +16319,7 @@ declare const app: Elysia<"/api", {
|
|
|
16218
16319
|
effectiveAt: Date;
|
|
16219
16320
|
} | null;
|
|
16220
16321
|
dailyChangeRate: string | null;
|
|
16322
|
+
minuteChangeRate: string | null;
|
|
16221
16323
|
trend10d: {
|
|
16222
16324
|
date: string;
|
|
16223
16325
|
price: string;
|
|
@@ -19054,6 +19156,244 @@ declare const app: Elysia<"/api", {
|
|
|
19054
19156
|
};
|
|
19055
19157
|
};
|
|
19056
19158
|
};
|
|
19159
|
+
} & {
|
|
19160
|
+
api: {
|
|
19161
|
+
market_data: {
|
|
19162
|
+
streaming: {
|
|
19163
|
+
subscribe: {
|
|
19164
|
+
body: {
|
|
19165
|
+
action: "subscribe";
|
|
19166
|
+
channels: {
|
|
19167
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19168
|
+
symbol: string;
|
|
19169
|
+
resolution?: string | undefined;
|
|
19170
|
+
}[];
|
|
19171
|
+
requestId?: string | undefined;
|
|
19172
|
+
} | {
|
|
19173
|
+
action: "unsubscribe";
|
|
19174
|
+
channels?: {
|
|
19175
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19176
|
+
symbol: string;
|
|
19177
|
+
resolution?: string | undefined;
|
|
19178
|
+
}[] | undefined;
|
|
19179
|
+
requestId?: string | undefined;
|
|
19180
|
+
} | {
|
|
19181
|
+
action: "ping";
|
|
19182
|
+
requestId?: string | undefined;
|
|
19183
|
+
};
|
|
19184
|
+
params: {};
|
|
19185
|
+
query: {};
|
|
19186
|
+
headers: {};
|
|
19187
|
+
response: {
|
|
19188
|
+
200: {
|
|
19189
|
+
type: "subscribed" | "unsubscribed";
|
|
19190
|
+
channels: {
|
|
19191
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19192
|
+
symbol: string;
|
|
19193
|
+
resolution?: string | undefined;
|
|
19194
|
+
}[];
|
|
19195
|
+
requestId?: string | undefined;
|
|
19196
|
+
errors?: {
|
|
19197
|
+
channel: {
|
|
19198
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19199
|
+
symbol: string;
|
|
19200
|
+
resolution?: string | undefined;
|
|
19201
|
+
};
|
|
19202
|
+
reason: string;
|
|
19203
|
+
}[] | undefined;
|
|
19204
|
+
} | {
|
|
19205
|
+
type: "error";
|
|
19206
|
+
message: string;
|
|
19207
|
+
requestId?: string | undefined;
|
|
19208
|
+
} | {
|
|
19209
|
+
type: "pong";
|
|
19210
|
+
requestId?: string | undefined;
|
|
19211
|
+
} | {
|
|
19212
|
+
channel: "trades";
|
|
19213
|
+
symbol: string;
|
|
19214
|
+
ts: number;
|
|
19215
|
+
price: string;
|
|
19216
|
+
size: string;
|
|
19217
|
+
side: "buy" | "sell";
|
|
19218
|
+
tradeId: string;
|
|
19219
|
+
matchId?: string | undefined;
|
|
19220
|
+
} | {
|
|
19221
|
+
channel: "depth";
|
|
19222
|
+
symbol: string;
|
|
19223
|
+
ts: number;
|
|
19224
|
+
bids: {
|
|
19225
|
+
price: string;
|
|
19226
|
+
size: string;
|
|
19227
|
+
}[];
|
|
19228
|
+
asks: {
|
|
19229
|
+
price: string;
|
|
19230
|
+
size: string;
|
|
19231
|
+
}[];
|
|
19232
|
+
seq?: number | undefined;
|
|
19233
|
+
isSnapshot?: boolean | undefined;
|
|
19234
|
+
} | {
|
|
19235
|
+
channel: "ticker";
|
|
19236
|
+
symbol: string;
|
|
19237
|
+
ts: number;
|
|
19238
|
+
open: string;
|
|
19239
|
+
high: string;
|
|
19240
|
+
low: string;
|
|
19241
|
+
close: string;
|
|
19242
|
+
baseVolume: string;
|
|
19243
|
+
quoteVolume: string;
|
|
19244
|
+
change: string;
|
|
19245
|
+
changePercent: string;
|
|
19246
|
+
} | {
|
|
19247
|
+
channel: "price";
|
|
19248
|
+
symbol: string;
|
|
19249
|
+
ts: number;
|
|
19250
|
+
price: string;
|
|
19251
|
+
source?: string | undefined;
|
|
19252
|
+
} | {
|
|
19253
|
+
channel: "bar";
|
|
19254
|
+
symbol: string;
|
|
19255
|
+
resolution: string;
|
|
19256
|
+
ts: number;
|
|
19257
|
+
open: string;
|
|
19258
|
+
high: string;
|
|
19259
|
+
low: string;
|
|
19260
|
+
close: string;
|
|
19261
|
+
volume: string;
|
|
19262
|
+
isFinal?: boolean | undefined;
|
|
19263
|
+
};
|
|
19264
|
+
422: {
|
|
19265
|
+
type: 'validation';
|
|
19266
|
+
on: string;
|
|
19267
|
+
summary?: string;
|
|
19268
|
+
message?: string;
|
|
19269
|
+
found?: unknown;
|
|
19270
|
+
property?: string;
|
|
19271
|
+
expected?: string;
|
|
19272
|
+
};
|
|
19273
|
+
};
|
|
19274
|
+
};
|
|
19275
|
+
};
|
|
19276
|
+
};
|
|
19277
|
+
} & {
|
|
19278
|
+
market_data: {
|
|
19279
|
+
market_data: {
|
|
19280
|
+
docs: {
|
|
19281
|
+
post: {
|
|
19282
|
+
body: {
|
|
19283
|
+
action: "subscribe";
|
|
19284
|
+
channels: {
|
|
19285
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19286
|
+
symbol: string;
|
|
19287
|
+
resolution?: string | undefined;
|
|
19288
|
+
}[];
|
|
19289
|
+
requestId?: string | undefined;
|
|
19290
|
+
} | {
|
|
19291
|
+
action: "unsubscribe";
|
|
19292
|
+
channels?: {
|
|
19293
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19294
|
+
symbol: string;
|
|
19295
|
+
resolution?: string | undefined;
|
|
19296
|
+
}[] | undefined;
|
|
19297
|
+
requestId?: string | undefined;
|
|
19298
|
+
} | {
|
|
19299
|
+
action: "ping";
|
|
19300
|
+
requestId?: string | undefined;
|
|
19301
|
+
};
|
|
19302
|
+
params: {};
|
|
19303
|
+
query: unknown;
|
|
19304
|
+
headers: unknown;
|
|
19305
|
+
response: {
|
|
19306
|
+
200: {
|
|
19307
|
+
type: "subscribed" | "unsubscribed";
|
|
19308
|
+
channels: {
|
|
19309
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19310
|
+
symbol: string;
|
|
19311
|
+
resolution?: string | undefined;
|
|
19312
|
+
}[];
|
|
19313
|
+
requestId?: string | undefined;
|
|
19314
|
+
errors?: {
|
|
19315
|
+
channel: {
|
|
19316
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
19317
|
+
symbol: string;
|
|
19318
|
+
resolution?: string | undefined;
|
|
19319
|
+
};
|
|
19320
|
+
reason: string;
|
|
19321
|
+
}[] | undefined;
|
|
19322
|
+
} | {
|
|
19323
|
+
type: "error";
|
|
19324
|
+
message: string;
|
|
19325
|
+
requestId?: string | undefined;
|
|
19326
|
+
} | {
|
|
19327
|
+
type: "pong";
|
|
19328
|
+
requestId?: string | undefined;
|
|
19329
|
+
} | {
|
|
19330
|
+
channel: "trades";
|
|
19331
|
+
symbol: string;
|
|
19332
|
+
ts: number;
|
|
19333
|
+
price: string;
|
|
19334
|
+
size: string;
|
|
19335
|
+
side: "buy" | "sell";
|
|
19336
|
+
tradeId: string;
|
|
19337
|
+
matchId?: string | undefined;
|
|
19338
|
+
} | {
|
|
19339
|
+
channel: "depth";
|
|
19340
|
+
symbol: string;
|
|
19341
|
+
ts: number;
|
|
19342
|
+
bids: {
|
|
19343
|
+
price: string;
|
|
19344
|
+
size: string;
|
|
19345
|
+
}[];
|
|
19346
|
+
asks: {
|
|
19347
|
+
price: string;
|
|
19348
|
+
size: string;
|
|
19349
|
+
}[];
|
|
19350
|
+
seq?: number | undefined;
|
|
19351
|
+
isSnapshot?: boolean | undefined;
|
|
19352
|
+
} | {
|
|
19353
|
+
channel: "ticker";
|
|
19354
|
+
symbol: string;
|
|
19355
|
+
ts: number;
|
|
19356
|
+
open: string;
|
|
19357
|
+
high: string;
|
|
19358
|
+
low: string;
|
|
19359
|
+
close: string;
|
|
19360
|
+
baseVolume: string;
|
|
19361
|
+
quoteVolume: string;
|
|
19362
|
+
change: string;
|
|
19363
|
+
changePercent: string;
|
|
19364
|
+
} | {
|
|
19365
|
+
channel: "price";
|
|
19366
|
+
symbol: string;
|
|
19367
|
+
ts: number;
|
|
19368
|
+
price: string;
|
|
19369
|
+
source?: string | undefined;
|
|
19370
|
+
} | {
|
|
19371
|
+
channel: "bar";
|
|
19372
|
+
symbol: string;
|
|
19373
|
+
resolution: string;
|
|
19374
|
+
ts: number;
|
|
19375
|
+
open: string;
|
|
19376
|
+
high: string;
|
|
19377
|
+
low: string;
|
|
19378
|
+
close: string;
|
|
19379
|
+
volume: string;
|
|
19380
|
+
isFinal?: boolean | undefined;
|
|
19381
|
+
};
|
|
19382
|
+
422: {
|
|
19383
|
+
type: 'validation';
|
|
19384
|
+
on: string;
|
|
19385
|
+
summary?: string;
|
|
19386
|
+
message?: string;
|
|
19387
|
+
found?: unknown;
|
|
19388
|
+
property?: string;
|
|
19389
|
+
expected?: string;
|
|
19390
|
+
};
|
|
19391
|
+
};
|
|
19392
|
+
};
|
|
19393
|
+
};
|
|
19394
|
+
};
|
|
19395
|
+
};
|
|
19396
|
+
};
|
|
19057
19397
|
} & {
|
|
19058
19398
|
api: {
|
|
19059
19399
|
udf: {};
|
|
@@ -21,6 +21,25 @@ export declare abstract class BaseMarketDataService {
|
|
|
21
21
|
protected static assertKlineTimeRange(startDate?: Date, endDate?: Date): void;
|
|
22
22
|
}
|
|
23
23
|
export declare abstract class InternalMarketDataService extends BaseMarketDataService {
|
|
24
|
+
static getLatestPriceSnapshotBySymbol(symbol: string): Promise<{
|
|
25
|
+
channel: 'price';
|
|
26
|
+
symbol: string;
|
|
27
|
+
ts: number;
|
|
28
|
+
price: string;
|
|
29
|
+
source: string;
|
|
30
|
+
} | null>;
|
|
31
|
+
static publishLatestPriceForPair(params: {
|
|
32
|
+
baseAssetId: string;
|
|
33
|
+
quoteAssetId: string;
|
|
34
|
+
price: string;
|
|
35
|
+
effectiveAt: Date;
|
|
36
|
+
source?: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
static publishInProgressBarForPair(params: {
|
|
39
|
+
baseAssetId: string;
|
|
40
|
+
quoteAssetId: string;
|
|
41
|
+
effectiveAt: Date;
|
|
42
|
+
}): Promise<void>;
|
|
24
43
|
static listKlines(query: {
|
|
25
44
|
symbol?: string;
|
|
26
45
|
resolution?: string;
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import Elysia from 'elysia';
|
|
2
|
+
export declare const MarketDataWSRouter: Elysia<"/market_data", {
|
|
3
|
+
decorator: {};
|
|
4
|
+
store: {};
|
|
5
|
+
derive: {};
|
|
6
|
+
resolve: {};
|
|
7
|
+
}, {
|
|
8
|
+
typebox: {
|
|
9
|
+
readonly clientMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
10
|
+
action: import("@sinclair/typebox").TLiteral<"subscribe">;
|
|
11
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
12
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
13
|
+
symbol: import("@sinclair/typebox").TString;
|
|
14
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
}>>;
|
|
16
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
18
|
+
action: import("@sinclair/typebox").TLiteral<"unsubscribe">;
|
|
19
|
+
channels: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
20
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
21
|
+
symbol: import("@sinclair/typebox").TString;
|
|
22
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
23
|
+
}>>>;
|
|
24
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
26
|
+
action: import("@sinclair/typebox").TLiteral<"ping">;
|
|
27
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
28
|
+
}>]>;
|
|
29
|
+
readonly serverMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
30
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"subscribed">, import("@sinclair/typebox").TLiteral<"unsubscribed">]>;
|
|
31
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
32
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
33
|
+
symbol: import("@sinclair/typebox").TString;
|
|
34
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
35
|
+
}>>;
|
|
36
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
|
+
errors: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
38
|
+
channel: import("@sinclair/typebox").TObject<{
|
|
39
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
40
|
+
symbol: import("@sinclair/typebox").TString;
|
|
41
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
42
|
+
}>;
|
|
43
|
+
reason: import("@sinclair/typebox").TString;
|
|
44
|
+
}>>>;
|
|
45
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
46
|
+
type: import("@sinclair/typebox").TLiteral<"error">;
|
|
47
|
+
message: import("@sinclair/typebox").TString;
|
|
48
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
49
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
50
|
+
type: import("@sinclair/typebox").TLiteral<"pong">;
|
|
51
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
52
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
53
|
+
channel: import("@sinclair/typebox").TLiteral<"trades">;
|
|
54
|
+
symbol: import("@sinclair/typebox").TString;
|
|
55
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
56
|
+
price: import("@sinclair/typebox").TString;
|
|
57
|
+
size: import("@sinclair/typebox").TString;
|
|
58
|
+
side: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"buy">, import("@sinclair/typebox").TLiteral<"sell">]>;
|
|
59
|
+
tradeId: import("@sinclair/typebox").TString;
|
|
60
|
+
matchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
61
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
62
|
+
channel: import("@sinclair/typebox").TLiteral<"depth">;
|
|
63
|
+
symbol: import("@sinclair/typebox").TString;
|
|
64
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
65
|
+
bids: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
66
|
+
price: import("@sinclair/typebox").TString;
|
|
67
|
+
size: import("@sinclair/typebox").TString;
|
|
68
|
+
}>>;
|
|
69
|
+
asks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
70
|
+
price: import("@sinclair/typebox").TString;
|
|
71
|
+
size: import("@sinclair/typebox").TString;
|
|
72
|
+
}>>;
|
|
73
|
+
seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
74
|
+
isSnapshot: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
75
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
76
|
+
channel: import("@sinclair/typebox").TLiteral<"ticker">;
|
|
77
|
+
symbol: import("@sinclair/typebox").TString;
|
|
78
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
79
|
+
open: import("@sinclair/typebox").TString;
|
|
80
|
+
high: import("@sinclair/typebox").TString;
|
|
81
|
+
low: import("@sinclair/typebox").TString;
|
|
82
|
+
close: import("@sinclair/typebox").TString;
|
|
83
|
+
baseVolume: import("@sinclair/typebox").TString;
|
|
84
|
+
quoteVolume: import("@sinclair/typebox").TString;
|
|
85
|
+
change: import("@sinclair/typebox").TString;
|
|
86
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
87
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
88
|
+
channel: import("@sinclair/typebox").TLiteral<"price">;
|
|
89
|
+
symbol: import("@sinclair/typebox").TString;
|
|
90
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
91
|
+
price: import("@sinclair/typebox").TString;
|
|
92
|
+
source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
93
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
94
|
+
channel: import("@sinclair/typebox").TLiteral<"bar">;
|
|
95
|
+
symbol: import("@sinclair/typebox").TString;
|
|
96
|
+
resolution: import("@sinclair/typebox").TString;
|
|
97
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
98
|
+
open: import("@sinclair/typebox").TString;
|
|
99
|
+
high: import("@sinclair/typebox").TString;
|
|
100
|
+
low: import("@sinclair/typebox").TString;
|
|
101
|
+
close: import("@sinclair/typebox").TString;
|
|
102
|
+
volume: import("@sinclair/typebox").TString;
|
|
103
|
+
isFinal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
104
|
+
}>]>;
|
|
105
|
+
};
|
|
106
|
+
error: {};
|
|
107
|
+
}, {
|
|
108
|
+
schema: {};
|
|
109
|
+
standaloneSchema: {};
|
|
110
|
+
macro: {};
|
|
111
|
+
macroFn: {};
|
|
112
|
+
parser: {};
|
|
113
|
+
response: {};
|
|
114
|
+
}, {
|
|
115
|
+
market_data: {
|
|
116
|
+
streaming: {
|
|
117
|
+
subscribe: {
|
|
118
|
+
body: {
|
|
119
|
+
action: "subscribe";
|
|
120
|
+
channels: {
|
|
121
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
122
|
+
symbol: string;
|
|
123
|
+
resolution?: string | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
requestId?: string | undefined;
|
|
126
|
+
} | {
|
|
127
|
+
action: "unsubscribe";
|
|
128
|
+
channels?: {
|
|
129
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
130
|
+
symbol: string;
|
|
131
|
+
resolution?: string | undefined;
|
|
132
|
+
}[] | undefined;
|
|
133
|
+
requestId?: string | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
action: "ping";
|
|
136
|
+
requestId?: string | undefined;
|
|
137
|
+
};
|
|
138
|
+
params: {};
|
|
139
|
+
query: {};
|
|
140
|
+
headers: {};
|
|
141
|
+
response: {
|
|
142
|
+
200: {
|
|
143
|
+
type: "subscribed" | "unsubscribed";
|
|
144
|
+
channels: {
|
|
145
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
146
|
+
symbol: string;
|
|
147
|
+
resolution?: string | undefined;
|
|
148
|
+
}[];
|
|
149
|
+
requestId?: string | undefined;
|
|
150
|
+
errors?: {
|
|
151
|
+
channel: {
|
|
152
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
153
|
+
symbol: string;
|
|
154
|
+
resolution?: string | undefined;
|
|
155
|
+
};
|
|
156
|
+
reason: string;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
} | {
|
|
159
|
+
type: "error";
|
|
160
|
+
message: string;
|
|
161
|
+
requestId?: string | undefined;
|
|
162
|
+
} | {
|
|
163
|
+
type: "pong";
|
|
164
|
+
requestId?: string | undefined;
|
|
165
|
+
} | {
|
|
166
|
+
channel: "trades";
|
|
167
|
+
symbol: string;
|
|
168
|
+
ts: number;
|
|
169
|
+
price: string;
|
|
170
|
+
size: string;
|
|
171
|
+
side: "buy" | "sell";
|
|
172
|
+
tradeId: string;
|
|
173
|
+
matchId?: string | undefined;
|
|
174
|
+
} | {
|
|
175
|
+
channel: "depth";
|
|
176
|
+
symbol: string;
|
|
177
|
+
ts: number;
|
|
178
|
+
bids: {
|
|
179
|
+
price: string;
|
|
180
|
+
size: string;
|
|
181
|
+
}[];
|
|
182
|
+
asks: {
|
|
183
|
+
price: string;
|
|
184
|
+
size: string;
|
|
185
|
+
}[];
|
|
186
|
+
seq?: number | undefined;
|
|
187
|
+
isSnapshot?: boolean | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
channel: "ticker";
|
|
190
|
+
symbol: string;
|
|
191
|
+
ts: number;
|
|
192
|
+
open: string;
|
|
193
|
+
high: string;
|
|
194
|
+
low: string;
|
|
195
|
+
close: string;
|
|
196
|
+
baseVolume: string;
|
|
197
|
+
quoteVolume: string;
|
|
198
|
+
change: string;
|
|
199
|
+
changePercent: string;
|
|
200
|
+
} | {
|
|
201
|
+
channel: "price";
|
|
202
|
+
symbol: string;
|
|
203
|
+
ts: number;
|
|
204
|
+
price: string;
|
|
205
|
+
source?: string | undefined;
|
|
206
|
+
} | {
|
|
207
|
+
channel: "bar";
|
|
208
|
+
symbol: string;
|
|
209
|
+
resolution: string;
|
|
210
|
+
ts: number;
|
|
211
|
+
open: string;
|
|
212
|
+
high: string;
|
|
213
|
+
low: string;
|
|
214
|
+
close: string;
|
|
215
|
+
volume: string;
|
|
216
|
+
isFinal?: boolean | undefined;
|
|
217
|
+
};
|
|
218
|
+
422: {
|
|
219
|
+
type: 'validation';
|
|
220
|
+
on: string;
|
|
221
|
+
summary?: string;
|
|
222
|
+
message?: string;
|
|
223
|
+
found?: unknown;
|
|
224
|
+
property?: string;
|
|
225
|
+
expected?: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
} & {
|
|
232
|
+
market_data: {
|
|
233
|
+
market_data: {
|
|
234
|
+
docs: {
|
|
235
|
+
post: {
|
|
236
|
+
body: {
|
|
237
|
+
action: "subscribe";
|
|
238
|
+
channels: {
|
|
239
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
240
|
+
symbol: string;
|
|
241
|
+
resolution?: string | undefined;
|
|
242
|
+
}[];
|
|
243
|
+
requestId?: string | undefined;
|
|
244
|
+
} | {
|
|
245
|
+
action: "unsubscribe";
|
|
246
|
+
channels?: {
|
|
247
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
248
|
+
symbol: string;
|
|
249
|
+
resolution?: string | undefined;
|
|
250
|
+
}[] | undefined;
|
|
251
|
+
requestId?: string | undefined;
|
|
252
|
+
} | {
|
|
253
|
+
action: "ping";
|
|
254
|
+
requestId?: string | undefined;
|
|
255
|
+
};
|
|
256
|
+
params: {};
|
|
257
|
+
query: unknown;
|
|
258
|
+
headers: unknown;
|
|
259
|
+
response: {
|
|
260
|
+
200: {
|
|
261
|
+
type: "subscribed" | "unsubscribed";
|
|
262
|
+
channels: {
|
|
263
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
264
|
+
symbol: string;
|
|
265
|
+
resolution?: string | undefined;
|
|
266
|
+
}[];
|
|
267
|
+
requestId?: string | undefined;
|
|
268
|
+
errors?: {
|
|
269
|
+
channel: {
|
|
270
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
271
|
+
symbol: string;
|
|
272
|
+
resolution?: string | undefined;
|
|
273
|
+
};
|
|
274
|
+
reason: string;
|
|
275
|
+
}[] | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
type: "error";
|
|
278
|
+
message: string;
|
|
279
|
+
requestId?: string | undefined;
|
|
280
|
+
} | {
|
|
281
|
+
type: "pong";
|
|
282
|
+
requestId?: string | undefined;
|
|
283
|
+
} | {
|
|
284
|
+
channel: "trades";
|
|
285
|
+
symbol: string;
|
|
286
|
+
ts: number;
|
|
287
|
+
price: string;
|
|
288
|
+
size: string;
|
|
289
|
+
side: "buy" | "sell";
|
|
290
|
+
tradeId: string;
|
|
291
|
+
matchId?: string | undefined;
|
|
292
|
+
} | {
|
|
293
|
+
channel: "depth";
|
|
294
|
+
symbol: string;
|
|
295
|
+
ts: number;
|
|
296
|
+
bids: {
|
|
297
|
+
price: string;
|
|
298
|
+
size: string;
|
|
299
|
+
}[];
|
|
300
|
+
asks: {
|
|
301
|
+
price: string;
|
|
302
|
+
size: string;
|
|
303
|
+
}[];
|
|
304
|
+
seq?: number | undefined;
|
|
305
|
+
isSnapshot?: boolean | undefined;
|
|
306
|
+
} | {
|
|
307
|
+
channel: "ticker";
|
|
308
|
+
symbol: string;
|
|
309
|
+
ts: number;
|
|
310
|
+
open: string;
|
|
311
|
+
high: string;
|
|
312
|
+
low: string;
|
|
313
|
+
close: string;
|
|
314
|
+
baseVolume: string;
|
|
315
|
+
quoteVolume: string;
|
|
316
|
+
change: string;
|
|
317
|
+
changePercent: string;
|
|
318
|
+
} | {
|
|
319
|
+
channel: "price";
|
|
320
|
+
symbol: string;
|
|
321
|
+
ts: number;
|
|
322
|
+
price: string;
|
|
323
|
+
source?: string | undefined;
|
|
324
|
+
} | {
|
|
325
|
+
channel: "bar";
|
|
326
|
+
symbol: string;
|
|
327
|
+
resolution: string;
|
|
328
|
+
ts: number;
|
|
329
|
+
open: string;
|
|
330
|
+
high: string;
|
|
331
|
+
low: string;
|
|
332
|
+
close: string;
|
|
333
|
+
volume: string;
|
|
334
|
+
isFinal?: boolean | undefined;
|
|
335
|
+
};
|
|
336
|
+
422: {
|
|
337
|
+
type: 'validation';
|
|
338
|
+
on: string;
|
|
339
|
+
summary?: string;
|
|
340
|
+
message?: string;
|
|
341
|
+
found?: unknown;
|
|
342
|
+
property?: string;
|
|
343
|
+
expected?: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
}, {
|
|
351
|
+
derive: {};
|
|
352
|
+
resolve: {};
|
|
353
|
+
schema: {};
|
|
354
|
+
standaloneSchema: {};
|
|
355
|
+
response: {};
|
|
356
|
+
}, {
|
|
357
|
+
derive: {};
|
|
358
|
+
resolve: {};
|
|
359
|
+
schema: {};
|
|
360
|
+
standaloneSchema: {};
|
|
361
|
+
response: {};
|
|
362
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SupportedResolution } from '../resolutions';
|
|
2
|
+
import type { BarEventPayload, LatestPriceEventPayload, ServerMessage } from './schema.v';
|
|
3
|
+
type WSPublisher = Bun.Server<unknown>;
|
|
4
|
+
export declare let wsPublisher: WSPublisher | null;
|
|
5
|
+
export declare function hasTopicSubscribers(topic: string): boolean;
|
|
6
|
+
export declare function hasBarSubscribers(symbol: string, resolution: SupportedResolution): boolean;
|
|
7
|
+
export declare function hasPriceSubscribers(symbol: string): boolean;
|
|
8
|
+
export declare function setWSPublisher(value: WSPublisher | null): void;
|
|
9
|
+
export declare function publishJSON(topic: string, data: ServerMessage, compress?: boolean): number | undefined;
|
|
10
|
+
export declare function publishBarEvent(payload: Omit<BarEventPayload, 'channel' | 'resolution'> & {
|
|
11
|
+
resolution: SupportedResolution;
|
|
12
|
+
}, compress?: boolean): number | undefined;
|
|
13
|
+
export declare function publishLatestPriceEvent(payload: Omit<LatestPriceEventPayload, 'channel'>, compress?: boolean): number | undefined;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
export declare const channelNameSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
2
|
+
export declare const subscribeChannelSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
4
|
+
symbol: import("@sinclair/typebox").TString;
|
|
5
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const subscribeMessageSchema: import("@sinclair/typebox").TObject<{
|
|
8
|
+
action: import("@sinclair/typebox").TLiteral<"subscribe">;
|
|
9
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
10
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
11
|
+
symbol: import("@sinclair/typebox").TString;
|
|
12
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
13
|
+
}>>;
|
|
14
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const unsubscribeMessageSchema: import("@sinclair/typebox").TObject<{
|
|
17
|
+
action: import("@sinclair/typebox").TLiteral<"unsubscribe">;
|
|
18
|
+
channels: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
19
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
20
|
+
symbol: import("@sinclair/typebox").TString;
|
|
21
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
|
+
}>>>;
|
|
23
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const pingMessageSchema: import("@sinclair/typebox").TObject<{
|
|
26
|
+
action: import("@sinclair/typebox").TLiteral<"ping">;
|
|
27
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const clientMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
30
|
+
action: import("@sinclair/typebox").TLiteral<"subscribe">;
|
|
31
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
32
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
33
|
+
symbol: import("@sinclair/typebox").TString;
|
|
34
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
35
|
+
}>>;
|
|
36
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
38
|
+
action: import("@sinclair/typebox").TLiteral<"unsubscribe">;
|
|
39
|
+
channels: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
40
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
41
|
+
symbol: import("@sinclair/typebox").TString;
|
|
42
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
43
|
+
}>>>;
|
|
44
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
45
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
46
|
+
action: import("@sinclair/typebox").TLiteral<"ping">;
|
|
47
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
48
|
+
}>]>;
|
|
49
|
+
export declare const ackResponseSchema: import("@sinclair/typebox").TObject<{
|
|
50
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"subscribed">, import("@sinclair/typebox").TLiteral<"unsubscribed">]>;
|
|
51
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
52
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
53
|
+
symbol: import("@sinclair/typebox").TString;
|
|
54
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
55
|
+
}>>;
|
|
56
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
57
|
+
errors: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
58
|
+
channel: import("@sinclair/typebox").TObject<{
|
|
59
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
60
|
+
symbol: import("@sinclair/typebox").TString;
|
|
61
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
62
|
+
}>;
|
|
63
|
+
reason: import("@sinclair/typebox").TString;
|
|
64
|
+
}>>>;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const errorResponseSchema: import("@sinclair/typebox").TObject<{
|
|
67
|
+
type: import("@sinclair/typebox").TLiteral<"error">;
|
|
68
|
+
message: import("@sinclair/typebox").TString;
|
|
69
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const pongResponseSchema: import("@sinclair/typebox").TObject<{
|
|
72
|
+
type: import("@sinclair/typebox").TLiteral<"pong">;
|
|
73
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const tradeEventSchema: import("@sinclair/typebox").TObject<{
|
|
76
|
+
channel: import("@sinclair/typebox").TLiteral<"trades">;
|
|
77
|
+
symbol: import("@sinclair/typebox").TString;
|
|
78
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
79
|
+
price: import("@sinclair/typebox").TString;
|
|
80
|
+
size: import("@sinclair/typebox").TString;
|
|
81
|
+
side: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"buy">, import("@sinclair/typebox").TLiteral<"sell">]>;
|
|
82
|
+
tradeId: import("@sinclair/typebox").TString;
|
|
83
|
+
matchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const depthEventSchema: import("@sinclair/typebox").TObject<{
|
|
86
|
+
channel: import("@sinclair/typebox").TLiteral<"depth">;
|
|
87
|
+
symbol: import("@sinclair/typebox").TString;
|
|
88
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
89
|
+
bids: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
90
|
+
price: import("@sinclair/typebox").TString;
|
|
91
|
+
size: import("@sinclair/typebox").TString;
|
|
92
|
+
}>>;
|
|
93
|
+
asks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
94
|
+
price: import("@sinclair/typebox").TString;
|
|
95
|
+
size: import("@sinclair/typebox").TString;
|
|
96
|
+
}>>;
|
|
97
|
+
seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
98
|
+
isSnapshot: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const tickerEventSchema: import("@sinclair/typebox").TObject<{
|
|
101
|
+
channel: import("@sinclair/typebox").TLiteral<"ticker">;
|
|
102
|
+
symbol: import("@sinclair/typebox").TString;
|
|
103
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
104
|
+
open: import("@sinclair/typebox").TString;
|
|
105
|
+
high: import("@sinclair/typebox").TString;
|
|
106
|
+
low: import("@sinclair/typebox").TString;
|
|
107
|
+
close: import("@sinclair/typebox").TString;
|
|
108
|
+
baseVolume: import("@sinclair/typebox").TString;
|
|
109
|
+
quoteVolume: import("@sinclair/typebox").TString;
|
|
110
|
+
change: import("@sinclair/typebox").TString;
|
|
111
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
112
|
+
}>;
|
|
113
|
+
export declare const latestPriceEventSchema: import("@sinclair/typebox").TObject<{
|
|
114
|
+
channel: import("@sinclair/typebox").TLiteral<"price">;
|
|
115
|
+
symbol: import("@sinclair/typebox").TString;
|
|
116
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
117
|
+
price: import("@sinclair/typebox").TString;
|
|
118
|
+
source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
119
|
+
}>;
|
|
120
|
+
export declare const barEventSchema: import("@sinclair/typebox").TObject<{
|
|
121
|
+
channel: import("@sinclair/typebox").TLiteral<"bar">;
|
|
122
|
+
symbol: import("@sinclair/typebox").TString;
|
|
123
|
+
resolution: import("@sinclair/typebox").TString;
|
|
124
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
125
|
+
open: import("@sinclair/typebox").TString;
|
|
126
|
+
high: import("@sinclair/typebox").TString;
|
|
127
|
+
low: import("@sinclair/typebox").TString;
|
|
128
|
+
close: import("@sinclair/typebox").TString;
|
|
129
|
+
volume: import("@sinclair/typebox").TString;
|
|
130
|
+
isFinal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
131
|
+
}>;
|
|
132
|
+
export declare const serverMessageSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
133
|
+
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"subscribed">, import("@sinclair/typebox").TLiteral<"unsubscribed">]>;
|
|
134
|
+
channels: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
135
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
136
|
+
symbol: import("@sinclair/typebox").TString;
|
|
137
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
138
|
+
}>>;
|
|
139
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
140
|
+
errors: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
141
|
+
channel: import("@sinclair/typebox").TObject<{
|
|
142
|
+
name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"depth">, import("@sinclair/typebox").TLiteral<"ticker">, import("@sinclair/typebox").TLiteral<"price">, import("@sinclair/typebox").TLiteral<"trades">, import("@sinclair/typebox").TLiteral<"bar">]>;
|
|
143
|
+
symbol: import("@sinclair/typebox").TString;
|
|
144
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
145
|
+
}>;
|
|
146
|
+
reason: import("@sinclair/typebox").TString;
|
|
147
|
+
}>>>;
|
|
148
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
149
|
+
type: import("@sinclair/typebox").TLiteral<"error">;
|
|
150
|
+
message: import("@sinclair/typebox").TString;
|
|
151
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
152
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
153
|
+
type: import("@sinclair/typebox").TLiteral<"pong">;
|
|
154
|
+
requestId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
155
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
156
|
+
channel: import("@sinclair/typebox").TLiteral<"trades">;
|
|
157
|
+
symbol: import("@sinclair/typebox").TString;
|
|
158
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
159
|
+
price: import("@sinclair/typebox").TString;
|
|
160
|
+
size: import("@sinclair/typebox").TString;
|
|
161
|
+
side: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"buy">, import("@sinclair/typebox").TLiteral<"sell">]>;
|
|
162
|
+
tradeId: import("@sinclair/typebox").TString;
|
|
163
|
+
matchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
164
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
165
|
+
channel: import("@sinclair/typebox").TLiteral<"depth">;
|
|
166
|
+
symbol: import("@sinclair/typebox").TString;
|
|
167
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
168
|
+
bids: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
169
|
+
price: import("@sinclair/typebox").TString;
|
|
170
|
+
size: import("@sinclair/typebox").TString;
|
|
171
|
+
}>>;
|
|
172
|
+
asks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
173
|
+
price: import("@sinclair/typebox").TString;
|
|
174
|
+
size: import("@sinclair/typebox").TString;
|
|
175
|
+
}>>;
|
|
176
|
+
seq: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
177
|
+
isSnapshot: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
178
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
179
|
+
channel: import("@sinclair/typebox").TLiteral<"ticker">;
|
|
180
|
+
symbol: import("@sinclair/typebox").TString;
|
|
181
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
182
|
+
open: import("@sinclair/typebox").TString;
|
|
183
|
+
high: import("@sinclair/typebox").TString;
|
|
184
|
+
low: import("@sinclair/typebox").TString;
|
|
185
|
+
close: import("@sinclair/typebox").TString;
|
|
186
|
+
baseVolume: import("@sinclair/typebox").TString;
|
|
187
|
+
quoteVolume: import("@sinclair/typebox").TString;
|
|
188
|
+
change: import("@sinclair/typebox").TString;
|
|
189
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
190
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
191
|
+
channel: import("@sinclair/typebox").TLiteral<"price">;
|
|
192
|
+
symbol: import("@sinclair/typebox").TString;
|
|
193
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
194
|
+
price: import("@sinclair/typebox").TString;
|
|
195
|
+
source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
196
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
197
|
+
channel: import("@sinclair/typebox").TLiteral<"bar">;
|
|
198
|
+
symbol: import("@sinclair/typebox").TString;
|
|
199
|
+
resolution: import("@sinclair/typebox").TString;
|
|
200
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
201
|
+
open: import("@sinclair/typebox").TString;
|
|
202
|
+
high: import("@sinclair/typebox").TString;
|
|
203
|
+
low: import("@sinclair/typebox").TString;
|
|
204
|
+
close: import("@sinclair/typebox").TString;
|
|
205
|
+
volume: import("@sinclair/typebox").TString;
|
|
206
|
+
isFinal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
207
|
+
}>]>;
|
|
208
|
+
export declare const tickerSnapshotResponseSchema: import("@sinclair/typebox").TObject<{
|
|
209
|
+
symbol: import("@sinclair/typebox").TString;
|
|
210
|
+
ts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
211
|
+
open: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
212
|
+
high: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
213
|
+
low: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
214
|
+
close: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
215
|
+
baseVolume: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
216
|
+
quoteVolume: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
217
|
+
change: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
218
|
+
changePercent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
219
|
+
hasData: import("@sinclair/typebox").TBoolean;
|
|
220
|
+
}>;
|
|
221
|
+
export declare const pricePreviewResponseSchema: import("@sinclair/typebox").TObject<{
|
|
222
|
+
symbol: import("@sinclair/typebox").TString;
|
|
223
|
+
source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"orderbook">, import("@sinclair/typebox").TLiteral<"last_trade">, import("@sinclair/typebox").TLiteral<"none">]>;
|
|
224
|
+
ts: import("@sinclair/typebox").TNumber;
|
|
225
|
+
bid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
226
|
+
ask: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
227
|
+
mid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
228
|
+
last: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
229
|
+
stale: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
230
|
+
hasData: import("@sinclair/typebox").TBoolean;
|
|
231
|
+
}>;
|
|
232
|
+
export declare const pricePerformanceWindowSchema: import("@sinclair/typebox").TObject<{
|
|
233
|
+
window: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"24h">, import("@sinclair/typebox").TLiteral<"7d">, import("@sinclair/typebox").TLiteral<"30d">]>;
|
|
234
|
+
change: import("@sinclair/typebox").TString;
|
|
235
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
236
|
+
hasData: import("@sinclair/typebox").TBoolean;
|
|
237
|
+
baseTs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
238
|
+
lastTs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
239
|
+
}>;
|
|
240
|
+
export declare const pricePerformanceResponseSchema: import("@sinclair/typebox").TObject<{
|
|
241
|
+
symbol: import("@sinclair/typebox").TString;
|
|
242
|
+
windows: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
243
|
+
window: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"24h">, import("@sinclair/typebox").TLiteral<"7d">, import("@sinclair/typebox").TLiteral<"30d">]>;
|
|
244
|
+
change: import("@sinclair/typebox").TString;
|
|
245
|
+
changePercent: import("@sinclair/typebox").TString;
|
|
246
|
+
hasData: import("@sinclair/typebox").TBoolean;
|
|
247
|
+
baseTs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
248
|
+
lastTs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
249
|
+
}>>;
|
|
250
|
+
}>;
|
|
251
|
+
export type SubscribeChannel = typeof subscribeChannelSchema.static;
|
|
252
|
+
export type ClientMessage = typeof clientMessageSchema.static;
|
|
253
|
+
export type TradeEventPayload = typeof tradeEventSchema.static;
|
|
254
|
+
export type DepthEventPayload = typeof depthEventSchema.static;
|
|
255
|
+
export type TickerEventPayload = typeof tickerEventSchema.static;
|
|
256
|
+
export type LatestPriceEventPayload = typeof latestPriceEventSchema.static;
|
|
257
|
+
export type BarEventPayload = typeof barEventSchema.static;
|
|
258
|
+
export type ServerMessage = typeof serverMessageSchema.static;
|
|
259
|
+
export type TickerSnapshotResponse = typeof tickerSnapshotResponseSchema.static;
|
|
260
|
+
export type PricePreviewResponse = typeof pricePreviewResponseSchema.static;
|
|
261
|
+
export type PricePerformanceWindow = typeof pricePerformanceWindowSchema.static;
|
|
262
|
+
export type PricePerformanceResponse = typeof pricePerformanceResponseSchema.static;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SupportedResolution } from '../resolutions';
|
|
2
|
+
import type { SubscribeChannel } from './schema.v';
|
|
3
|
+
export declare function normalizeAndValidateChannels(channels: SubscribeChannel[]): Promise<{
|
|
4
|
+
accepted: {
|
|
5
|
+
name: "bar" | "depth" | "price" | "ticker" | "trades";
|
|
6
|
+
symbol: string;
|
|
7
|
+
resolution?: string | undefined;
|
|
8
|
+
}[];
|
|
9
|
+
errors: {
|
|
10
|
+
channel: SubscribeChannel;
|
|
11
|
+
reason: string;
|
|
12
|
+
}[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function normalizeSymbol(input: string): string;
|
|
15
|
+
export type MarketDataChannel = SubscribeChannel['name'];
|
|
16
|
+
export declare const MARKET_DATA_TOPIC_PREFIX = "md";
|
|
17
|
+
export declare function buildTopic(channel: MarketDataChannel, symbol: string, resolution?: SupportedResolution): `md.bar.${string}.1` | `md.bar.${string}.15` | `md.bar.${string}.1D` | `md.bar.${string}.1M` | `md.bar.${string}.1W` | `md.bar.${string}.240` | `md.bar.${string}.30` | `md.bar.${string}.5` | `md.bar.${string}.60` | `md.depth.${string}` | `md.price.${string}` | `md.ticker.${string}` | `md.trades.${string}`;
|
|
18
|
+
export declare function buildTopicForSubscription(channel: SubscribeChannel): `md.bar.${string}.1` | `md.bar.${string}.15` | `md.bar.${string}.1D` | `md.bar.${string}.1M` | `md.bar.${string}.1W` | `md.bar.${string}.240` | `md.bar.${string}.30` | `md.bar.${string}.5` | `md.bar.${string}.60` | `md.depth.${string}` | `md.price.${string}` | `md.ticker.${string}` | `md.trades.${string}`;
|
|
@@ -35,19 +35,7 @@ export declare const marketPricingAdminRouter: Elysia<"/market_pricing", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
39
|
-
domain?: string | undefined;
|
|
40
|
-
expires?: Date | undefined;
|
|
41
|
-
httpOnly?: boolean | undefined;
|
|
42
|
-
maxAge?: number | undefined;
|
|
43
|
-
path?: string | undefined;
|
|
44
|
-
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
-
partitioned?: boolean | undefined;
|
|
46
|
-
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
-
secure?: boolean | undefined;
|
|
48
|
-
secrets?: string | null | (string | null)[];
|
|
49
|
-
value?: unknown;
|
|
50
|
-
}>;
|
|
38
|
+
cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
|
|
51
39
|
};
|
|
52
40
|
path: string;
|
|
53
41
|
route: string;
|
|
@@ -35,7 +35,19 @@ export declare const newsAdminRouter: Elysia<"/news", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
38
|
+
cookie?: Record<string, {
|
|
39
|
+
domain?: string | undefined;
|
|
40
|
+
expires?: Date | undefined;
|
|
41
|
+
httpOnly?: boolean | undefined;
|
|
42
|
+
maxAge?: number | undefined;
|
|
43
|
+
path?: string | undefined;
|
|
44
|
+
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
+
partitioned?: boolean | undefined;
|
|
46
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
+
secure?: boolean | undefined;
|
|
48
|
+
secrets?: string | null | (string | null)[];
|
|
49
|
+
value?: unknown;
|
|
50
|
+
}>;
|
|
39
51
|
};
|
|
40
52
|
path: string;
|
|
41
53
|
route: string;
|
|
@@ -35,19 +35,7 @@ export declare const userSecurityRouter: Elysia<"/user", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
39
|
-
domain?: string | undefined;
|
|
40
|
-
expires?: Date | undefined;
|
|
41
|
-
httpOnly?: boolean | undefined;
|
|
42
|
-
maxAge?: number | undefined;
|
|
43
|
-
path?: string | undefined;
|
|
44
|
-
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
-
partitioned?: boolean | undefined;
|
|
46
|
-
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
-
secure?: boolean | undefined;
|
|
48
|
-
secrets?: string | null | (string | null)[];
|
|
49
|
-
value?: unknown;
|
|
50
|
-
}>;
|
|
38
|
+
cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
|
|
51
39
|
};
|
|
52
40
|
path: string;
|
|
53
41
|
route: string;
|