@proton/wrap-constants 0.2.43 → 0.2.45
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 +20 -61
- package/dist/wrap-constants.cjs.development.js +11 -26
- 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 +12 -26
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/parsers/dex.ts +8 -24
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.45",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"resolutions": {
|
|
45
45
|
"typescript": "4.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "60eea545a19a85f308af2084ab11f5c47ae63db6"
|
|
48
48
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -17,7 +17,7 @@ export const getOhlcvParser = z.object({
|
|
|
17
17
|
from: z.string(),
|
|
18
18
|
to: z.string(),
|
|
19
19
|
symbol: z.string(),
|
|
20
|
-
limit: z.
|
|
20
|
+
limit: z.string().default("500").refine(n => +n <= 1000, 'Max limit is 1000'),
|
|
21
21
|
})
|
|
22
22
|
export type GetOHLCV = z.infer<typeof getOhlcvParser>
|
|
23
23
|
|
|
@@ -50,8 +50,8 @@ export type OrderHistory = z.infer<typeof orderHistoryParser>
|
|
|
50
50
|
export const getOrderHistoryParser = z.object({
|
|
51
51
|
account: z.string(),
|
|
52
52
|
symbol: z.string().optional(),
|
|
53
|
-
offset: z.
|
|
54
|
-
limit: z.
|
|
53
|
+
offset: z.string().default("0"),
|
|
54
|
+
limit: z.string().default("100").refine(n => +n <= 250, 'Max limit is 250'),
|
|
55
55
|
})
|
|
56
56
|
export type GetOrderHistory = z.infer<typeof getOrderHistoryParser>
|
|
57
57
|
|
|
@@ -73,7 +73,7 @@ export type Depth = z.infer<typeof depthParser>
|
|
|
73
73
|
export const getDepthParser = z.object({
|
|
74
74
|
symbol: z.string(),
|
|
75
75
|
step: z.string(),
|
|
76
|
-
limit: z.
|
|
76
|
+
limit: z.string().default("100").refine(n => +n <= 250, 'Max limit is 250'),
|
|
77
77
|
})
|
|
78
78
|
export type GetDepth = z.infer<typeof getDepthParser>
|
|
79
79
|
|
|
@@ -127,27 +127,11 @@ export const marketParser = z.object({
|
|
|
127
127
|
})
|
|
128
128
|
export type Market = z.infer<typeof marketParser>
|
|
129
129
|
|
|
130
|
-
export const
|
|
130
|
+
export const getMarketsResponseParser = z.object({
|
|
131
131
|
sync: z.number(),
|
|
132
132
|
data: z.array(marketParser)
|
|
133
133
|
})
|
|
134
|
-
export type GetMarketsResponse = z.infer<typeof
|
|
135
|
-
|
|
136
|
-
export const getMarketsResponseParser = z.array(z.object({
|
|
137
|
-
market_id: z.number(),
|
|
138
|
-
symbol: z.string(),
|
|
139
|
-
status_code: z.number(),
|
|
140
|
-
base_id: z.string(),
|
|
141
|
-
quote_id: z.string(),
|
|
142
|
-
type: z.string(),
|
|
143
|
-
maker_fee: z.number(),
|
|
144
|
-
taker_fee: z.number(),
|
|
145
|
-
base_precision: z.number(),
|
|
146
|
-
quote_precision: z.number(),
|
|
147
|
-
base_contract: z.string(),
|
|
148
|
-
quote_contract: z.string(),
|
|
149
|
-
}))
|
|
150
|
-
export type GetMarketsResponseParser = z.infer<typeof getMarketsResponseParser>
|
|
134
|
+
export type GetMarketsResponse = z.infer<typeof getMarketsResponseParser>
|
|
151
135
|
|
|
152
136
|
export const tradeParser = z.object({
|
|
153
137
|
block_num: z.number(),
|
|
@@ -172,8 +156,8 @@ export type Trade = z.infer<typeof tradeParser>
|
|
|
172
156
|
|
|
173
157
|
export const getTradesParser = z.object({
|
|
174
158
|
symbol: z.string(),
|
|
175
|
-
offset: z.
|
|
176
|
-
limit: z.
|
|
159
|
+
offset: z.string().default("0"),
|
|
160
|
+
limit: z.string().default("100").refine(n => +n <= 250, 'Max limit is 250'),
|
|
177
161
|
})
|
|
178
162
|
export type GetTrades = z.infer<typeof getTradesParser>
|
|
179
163
|
|