@proton/wrap-constants 0.2.36 → 0.2.38
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/parsers/dex.d.ts +412 -0
- package/dist/wrap-constants.cjs.development.js +35 -0
- package/dist/wrap-constants.cjs.development.js.map +1 -1
- package/dist/wrap-constants.cjs.production.min.js +1 -1
- package/dist/wrap-constants.cjs.production.min.js.map +1 -1
- package/dist/wrap-constants.esm.js +30 -1
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/parsers/dex.ts +41 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.38",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"analyze": "size-limit --why"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@bloks/numbers": "^
|
|
29
|
+
"@bloks/numbers": "^27.0.0",
|
|
30
30
|
"@bloks/utils": "^25.0.0",
|
|
31
31
|
"@proton/js": "^26.0.1",
|
|
32
32
|
"@size-limit/preset-small-lib": "^4.9.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"resolutions": {
|
|
45
45
|
"typescript": "4.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d96571f93cbdcd10d09bdc1b6dfd41041205700b"
|
|
48
48
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -24,6 +24,12 @@ export const getOhlcvParser = z.object({
|
|
|
24
24
|
})
|
|
25
25
|
export type GetOHLCV = z.infer<typeof getOhlcvParser>
|
|
26
26
|
|
|
27
|
+
export const getOhlcvResponse = z.object({
|
|
28
|
+
sync: z.number(),
|
|
29
|
+
data: z.array(ohlcvParser)
|
|
30
|
+
})
|
|
31
|
+
export type GetOHLCVResponse = z.infer<typeof getOhlcvResponse>
|
|
32
|
+
|
|
27
33
|
export const orderHistoryParser = z.object({
|
|
28
34
|
seq: z.number(),
|
|
29
35
|
block_num: z.number(),
|
|
@@ -52,6 +58,13 @@ export const getOrderHistoryParser = z.object({
|
|
|
52
58
|
})
|
|
53
59
|
export type GetOrderHistory = z.infer<typeof getOrderHistoryParser>
|
|
54
60
|
|
|
61
|
+
export const getOrderHistoryResponseParser = z.object({
|
|
62
|
+
sync: z.number(),
|
|
63
|
+
count: z.number(),
|
|
64
|
+
data: z.array(orderHistoryParser)
|
|
65
|
+
})
|
|
66
|
+
export type GetOrderHistoryResponse = z.infer<typeof getOrderHistoryResponseParser>
|
|
67
|
+
|
|
55
68
|
export const depthParser = z.object({
|
|
56
69
|
level: z.number(),
|
|
57
70
|
ask: z.number(),
|
|
@@ -67,6 +80,15 @@ export const getDepthParser = z.object({
|
|
|
67
80
|
})
|
|
68
81
|
export type GetDepth = z.infer<typeof getDepthParser>
|
|
69
82
|
|
|
83
|
+
export const getDepthResponseParser = z.object({
|
|
84
|
+
sync: z.number(),
|
|
85
|
+
data: z.object({
|
|
86
|
+
bids: z.array(depthParser),
|
|
87
|
+
asks: z.array(depthParser),
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
export type GetDepthResponse = z.infer<typeof getDepthResponseParser>
|
|
91
|
+
|
|
70
92
|
export const dailyParser = z.object({
|
|
71
93
|
market_id: z.number(),
|
|
72
94
|
first: z.number(),
|
|
@@ -77,6 +99,12 @@ export const dailyParser = z.object({
|
|
|
77
99
|
})
|
|
78
100
|
export type Daily = z.infer<typeof dailyParser>
|
|
79
101
|
|
|
102
|
+
export const getDailyResponseParser = z.object({
|
|
103
|
+
sync: z.number(),
|
|
104
|
+
data: z.array(dailyParser)
|
|
105
|
+
})
|
|
106
|
+
export type GetDailyResponseParser = z.infer<typeof getDailyResponseParser>
|
|
107
|
+
|
|
80
108
|
export const tradeParser = z.object({
|
|
81
109
|
block_num: z.number(),
|
|
82
110
|
block_time: z.string(),
|
|
@@ -105,6 +133,12 @@ export const getTradesParser = z.object({
|
|
|
105
133
|
})
|
|
106
134
|
export type GetTrades = z.infer<typeof getTradesParser>
|
|
107
135
|
|
|
136
|
+
export const getTradesResponseParser = z.object({
|
|
137
|
+
sync: z.number(),
|
|
138
|
+
data: z.array(tradeParser)
|
|
139
|
+
})
|
|
140
|
+
export type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>
|
|
141
|
+
|
|
108
142
|
export const syncParser = z.object({
|
|
109
143
|
sourceid: z.number(),
|
|
110
144
|
block_num: z.string(),
|
|
@@ -115,6 +149,13 @@ export const syncParser = z.object({
|
|
|
115
149
|
})
|
|
116
150
|
export type Sync = z.infer<typeof syncParser>
|
|
117
151
|
|
|
152
|
+
export const getSyncResponseParser = z.object({
|
|
153
|
+
dbSecondsBehind: z.number(),
|
|
154
|
+
chronicleSecondsBehind: z.number(),
|
|
155
|
+
maxSecondsBehind: z.number()
|
|
156
|
+
})
|
|
157
|
+
export type GetSyncResponse = z.infer<typeof getSyncResponseParser>
|
|
158
|
+
|
|
118
159
|
export enum orderType { ORDERBOOK = 0, LIMIT = 1, STOPLOSS = 2, TAKEPROFIT = 3 }
|
|
119
160
|
|
|
120
161
|
export enum orderSide { INVALID = 0, BUY = 1, SELL = 2 }
|