@proton/wrap-constants 0.2.86 → 0.2.87
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/index.d.ts +3 -3
- package/dist/index.js +8 -7
- package/dist/index.mjs +8 -7
- package/package.json +2 -2
- package/src/parsers/dex.ts +13 -25
package/dist/index.d.ts
CHANGED
|
@@ -7488,17 +7488,14 @@ declare const getTradesParser: z.ZodObject<{
|
|
|
7488
7488
|
symbol: z.ZodString;
|
|
7489
7489
|
offset: z.ZodDefault<z.ZodString>;
|
|
7490
7490
|
limit: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
7491
|
-
ordinal_order_id: z.ZodOptional<z.ZodString>;
|
|
7492
7491
|
}, "strip", z.ZodTypeAny, {
|
|
7493
7492
|
symbol: string;
|
|
7494
7493
|
limit: string;
|
|
7495
7494
|
offset: string;
|
|
7496
|
-
ordinal_order_id?: string | undefined;
|
|
7497
7495
|
}, {
|
|
7498
7496
|
symbol: string;
|
|
7499
7497
|
offset?: string | undefined;
|
|
7500
7498
|
limit?: string | undefined;
|
|
7501
|
-
ordinal_order_id?: string | undefined;
|
|
7502
7499
|
}>;
|
|
7503
7500
|
declare type GetTrades = z.infer<typeof getTradesParser>;
|
|
7504
7501
|
declare const getTradesResponseParser: z.ZodObject<{
|
|
@@ -7616,16 +7613,19 @@ declare const getTradeHistoryParser: z.ZodObject<{
|
|
|
7616
7613
|
account: z.ZodString;
|
|
7617
7614
|
symbol: z.ZodOptional<z.ZodString>;
|
|
7618
7615
|
offset: z.ZodDefault<z.ZodString>;
|
|
7616
|
+
ordinal_order_id: z.ZodOptional<z.ZodString>;
|
|
7619
7617
|
limit: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
7620
7618
|
}, "strip", z.ZodTypeAny, {
|
|
7621
7619
|
account: string;
|
|
7622
7620
|
limit: string;
|
|
7623
7621
|
offset: string;
|
|
7624
7622
|
symbol?: string | undefined;
|
|
7623
|
+
ordinal_order_id?: string | undefined;
|
|
7625
7624
|
}, {
|
|
7626
7625
|
account: string;
|
|
7627
7626
|
symbol?: string | undefined;
|
|
7628
7627
|
offset?: string | undefined;
|
|
7628
|
+
ordinal_order_id?: string | undefined;
|
|
7629
7629
|
limit?: string | undefined;
|
|
7630
7630
|
}>;
|
|
7631
7631
|
declare type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
|
package/dist/index.js
CHANGED
|
@@ -1829,6 +1829,7 @@ var wrapParser = z10.object({
|
|
|
1829
1829
|
|
|
1830
1830
|
// src/parsers/dex.ts
|
|
1831
1831
|
var z11 = __toESM(require("zod"));
|
|
1832
|
+
var createLimit = (def, max) => z11.string().default(String(def)).refine((n) => +n <= max, "Max limit is 250");
|
|
1832
1833
|
var ohlcvParser = z11.object({
|
|
1833
1834
|
time: z11.number(),
|
|
1834
1835
|
open: z11.number(),
|
|
@@ -1844,7 +1845,7 @@ var getOhlcvParser = z11.object({
|
|
|
1844
1845
|
from: z11.string(),
|
|
1845
1846
|
to: z11.string(),
|
|
1846
1847
|
symbol: z11.string(),
|
|
1847
|
-
limit:
|
|
1848
|
+
limit: createLimit(500, 1e3)
|
|
1848
1849
|
});
|
|
1849
1850
|
var getOhlcvResponseParser = z11.object({
|
|
1850
1851
|
sync: z11.number(),
|
|
@@ -1876,7 +1877,7 @@ var getOpenOrdersParser = z11.object({
|
|
|
1876
1877
|
account: z11.string(),
|
|
1877
1878
|
symbol: z11.string().optional(),
|
|
1878
1879
|
offset: z11.string().default("0"),
|
|
1879
|
-
limit:
|
|
1880
|
+
limit: createLimit(100, 250),
|
|
1880
1881
|
ordinal_order_id: z11.string().optional()
|
|
1881
1882
|
});
|
|
1882
1883
|
var getOpenOrdersResponseParser = z11.object({
|
|
@@ -1888,7 +1889,7 @@ var getOrderHistoryParser = z11.object({
|
|
|
1888
1889
|
account: z11.string(),
|
|
1889
1890
|
symbol: z11.string().optional(),
|
|
1890
1891
|
offset: z11.string().default("0"),
|
|
1891
|
-
limit:
|
|
1892
|
+
limit: createLimit(100, 250),
|
|
1892
1893
|
ordinal_order_id: z11.string().optional(),
|
|
1893
1894
|
trx_id: z11.string().optional(),
|
|
1894
1895
|
status: z11.string().optional()
|
|
@@ -1927,7 +1928,7 @@ var depthParser = z11.object({
|
|
|
1927
1928
|
var getDepthParser = z11.object({
|
|
1928
1929
|
symbol: z11.string(),
|
|
1929
1930
|
step: z11.string(),
|
|
1930
|
-
limit:
|
|
1931
|
+
limit: createLimit(100, 250)
|
|
1931
1932
|
});
|
|
1932
1933
|
var getDepthResponseParser = z11.object({
|
|
1933
1934
|
sync: z11.number(),
|
|
@@ -2000,8 +2001,7 @@ var tradeParser = z11.object({
|
|
|
2000
2001
|
var getTradesParser = z11.object({
|
|
2001
2002
|
symbol: z11.string(),
|
|
2002
2003
|
offset: z11.string().default("0"),
|
|
2003
|
-
limit:
|
|
2004
|
-
ordinal_order_id: z11.string().optional()
|
|
2004
|
+
limit: createLimit(100, 250)
|
|
2005
2005
|
});
|
|
2006
2006
|
var getTradesResponseParser = z11.object({
|
|
2007
2007
|
sync: z11.number(),
|
|
@@ -2011,7 +2011,8 @@ var getTradeHistoryParser = z11.object({
|
|
|
2011
2011
|
account: z11.string(),
|
|
2012
2012
|
symbol: z11.string().optional(),
|
|
2013
2013
|
offset: z11.string().default("0"),
|
|
2014
|
-
|
|
2014
|
+
ordinal_order_id: z11.string().optional(),
|
|
2015
|
+
limit: createLimit(100, 250)
|
|
2015
2016
|
});
|
|
2016
2017
|
var getTradeHistoryResponseParser = z11.object({
|
|
2017
2018
|
sync: z11.number(),
|
package/dist/index.mjs
CHANGED
|
@@ -1699,6 +1699,7 @@ var wrapParser = z10.object({
|
|
|
1699
1699
|
|
|
1700
1700
|
// src/parsers/dex.ts
|
|
1701
1701
|
import * as z11 from "zod";
|
|
1702
|
+
var createLimit = (def, max) => z11.string().default(String(def)).refine((n) => +n <= max, "Max limit is 250");
|
|
1702
1703
|
var ohlcvParser = z11.object({
|
|
1703
1704
|
time: z11.number(),
|
|
1704
1705
|
open: z11.number(),
|
|
@@ -1714,7 +1715,7 @@ var getOhlcvParser = z11.object({
|
|
|
1714
1715
|
from: z11.string(),
|
|
1715
1716
|
to: z11.string(),
|
|
1716
1717
|
symbol: z11.string(),
|
|
1717
|
-
limit:
|
|
1718
|
+
limit: createLimit(500, 1e3)
|
|
1718
1719
|
});
|
|
1719
1720
|
var getOhlcvResponseParser = z11.object({
|
|
1720
1721
|
sync: z11.number(),
|
|
@@ -1746,7 +1747,7 @@ var getOpenOrdersParser = z11.object({
|
|
|
1746
1747
|
account: z11.string(),
|
|
1747
1748
|
symbol: z11.string().optional(),
|
|
1748
1749
|
offset: z11.string().default("0"),
|
|
1749
|
-
limit:
|
|
1750
|
+
limit: createLimit(100, 250),
|
|
1750
1751
|
ordinal_order_id: z11.string().optional()
|
|
1751
1752
|
});
|
|
1752
1753
|
var getOpenOrdersResponseParser = z11.object({
|
|
@@ -1758,7 +1759,7 @@ var getOrderHistoryParser = z11.object({
|
|
|
1758
1759
|
account: z11.string(),
|
|
1759
1760
|
symbol: z11.string().optional(),
|
|
1760
1761
|
offset: z11.string().default("0"),
|
|
1761
|
-
limit:
|
|
1762
|
+
limit: createLimit(100, 250),
|
|
1762
1763
|
ordinal_order_id: z11.string().optional(),
|
|
1763
1764
|
trx_id: z11.string().optional(),
|
|
1764
1765
|
status: z11.string().optional()
|
|
@@ -1797,7 +1798,7 @@ var depthParser = z11.object({
|
|
|
1797
1798
|
var getDepthParser = z11.object({
|
|
1798
1799
|
symbol: z11.string(),
|
|
1799
1800
|
step: z11.string(),
|
|
1800
|
-
limit:
|
|
1801
|
+
limit: createLimit(100, 250)
|
|
1801
1802
|
});
|
|
1802
1803
|
var getDepthResponseParser = z11.object({
|
|
1803
1804
|
sync: z11.number(),
|
|
@@ -1870,8 +1871,7 @@ var tradeParser = z11.object({
|
|
|
1870
1871
|
var getTradesParser = z11.object({
|
|
1871
1872
|
symbol: z11.string(),
|
|
1872
1873
|
offset: z11.string().default("0"),
|
|
1873
|
-
limit:
|
|
1874
|
-
ordinal_order_id: z11.string().optional()
|
|
1874
|
+
limit: createLimit(100, 250)
|
|
1875
1875
|
});
|
|
1876
1876
|
var getTradesResponseParser = z11.object({
|
|
1877
1877
|
sync: z11.number(),
|
|
@@ -1881,7 +1881,8 @@ var getTradeHistoryParser = z11.object({
|
|
|
1881
1881
|
account: z11.string(),
|
|
1882
1882
|
symbol: z11.string().optional(),
|
|
1883
1883
|
offset: z11.string().default("0"),
|
|
1884
|
-
|
|
1884
|
+
ordinal_order_id: z11.string().optional(),
|
|
1885
|
+
limit: createLimit(100, 250)
|
|
1885
1886
|
});
|
|
1886
1887
|
var getTradeHistoryResponseParser = z11.object({
|
|
1887
1888
|
sync: z11.number(),
|
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.87",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"resolutions": {
|
|
41
41
|
"typescript": "4.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "dfc34f84bfebfb81c7b0168ed5685bef07c45e6f"
|
|
44
44
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
|
|
3
|
+
const createLimit = (def: number, max: number) =>
|
|
4
|
+
z
|
|
5
|
+
.string()
|
|
6
|
+
.default(String(def))
|
|
7
|
+
.refine((n) => +n <= max, "Max limit is 250");
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* OHLCV
|
|
5
11
|
*/
|
|
@@ -20,10 +26,7 @@ export const getOhlcvParser = z.object({
|
|
|
20
26
|
from: z.string(),
|
|
21
27
|
to: z.string(),
|
|
22
28
|
symbol: z.string(),
|
|
23
|
-
limit:
|
|
24
|
-
.string()
|
|
25
|
-
.default("500")
|
|
26
|
-
.refine((n) => +n <= 1000, "Max limit is 1000"),
|
|
29
|
+
limit: createLimit(500, 1000),
|
|
27
30
|
});
|
|
28
31
|
export type GetOHLCV = z.infer<typeof getOhlcvParser>;
|
|
29
32
|
|
|
@@ -64,10 +67,7 @@ export const getOpenOrdersParser = z.object({
|
|
|
64
67
|
account: z.string(),
|
|
65
68
|
symbol: z.string().optional(),
|
|
66
69
|
offset: z.string().default("0"),
|
|
67
|
-
limit:
|
|
68
|
-
.string()
|
|
69
|
-
.default("100")
|
|
70
|
-
.refine((n) => +n <= 250, "Max limit is 250"),
|
|
70
|
+
limit: createLimit(100, 250),
|
|
71
71
|
ordinal_order_id: z.string().optional(),
|
|
72
72
|
});
|
|
73
73
|
export type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
|
|
@@ -83,10 +83,7 @@ export const getOrderHistoryParser = z.object({
|
|
|
83
83
|
account: z.string(),
|
|
84
84
|
symbol: z.string().optional(),
|
|
85
85
|
offset: z.string().default("0"),
|
|
86
|
-
limit:
|
|
87
|
-
.string()
|
|
88
|
-
.default("100")
|
|
89
|
-
.refine((n) => +n <= 250, "Max limit is 250"),
|
|
86
|
+
limit: createLimit(100, 250),
|
|
90
87
|
ordinal_order_id: z.string().optional(),
|
|
91
88
|
trx_id: z.string().optional(),
|
|
92
89
|
status: z.string().optional(),
|
|
@@ -146,10 +143,7 @@ export type Depth = z.infer<typeof depthParser>;
|
|
|
146
143
|
export const getDepthParser = z.object({
|
|
147
144
|
symbol: z.string(),
|
|
148
145
|
step: z.string(),
|
|
149
|
-
limit:
|
|
150
|
-
.string()
|
|
151
|
-
.default("100")
|
|
152
|
-
.refine((n) => +n <= 250, "Max limit is 250"),
|
|
146
|
+
limit: createLimit(100, 250),
|
|
153
147
|
});
|
|
154
148
|
export type GetDepth = z.infer<typeof getDepthParser>;
|
|
155
149
|
|
|
@@ -245,11 +239,7 @@ export type Trade = z.infer<typeof tradeParser>;
|
|
|
245
239
|
export const getTradesParser = z.object({
|
|
246
240
|
symbol: z.string(),
|
|
247
241
|
offset: z.string().default("0"),
|
|
248
|
-
limit:
|
|
249
|
-
.string()
|
|
250
|
-
.default("100")
|
|
251
|
-
.refine((n) => +n <= 250, "Max limit is 250"),
|
|
252
|
-
ordinal_order_id: z.string().optional(),
|
|
242
|
+
limit: createLimit(100, 250),
|
|
253
243
|
});
|
|
254
244
|
export type GetTrades = z.infer<typeof getTradesParser>;
|
|
255
245
|
|
|
@@ -263,10 +253,8 @@ export const getTradeHistoryParser = z.object({
|
|
|
263
253
|
account: z.string(),
|
|
264
254
|
symbol: z.string().optional(),
|
|
265
255
|
offset: z.string().default("0"),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
.default("100")
|
|
269
|
-
.refine((n) => +n <= 250, "Max limit is 250"),
|
|
256
|
+
ordinal_order_id: z.string().optional(),
|
|
257
|
+
limit: createLimit(100, 250),
|
|
270
258
|
});
|
|
271
259
|
export type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
|
|
272
260
|
|