@proton/wrap-constants 0.2.121 → 0.2.122
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 +30 -30
- package/dist/index.js +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +2 -2
- package/src/parsers/dex.ts +10 -8
package/dist/index.d.ts
CHANGED
|
@@ -6397,19 +6397,19 @@ declare const getOhlcvParser: z.ZodObject<{
|
|
|
6397
6397
|
from: z.ZodString;
|
|
6398
6398
|
to: z.ZodString;
|
|
6399
6399
|
symbol: z.ZodString;
|
|
6400
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6400
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6401
6401
|
}, "strip", z.ZodTypeAny, {
|
|
6402
6402
|
symbol: string;
|
|
6403
6403
|
from: string;
|
|
6404
6404
|
to: string;
|
|
6405
6405
|
interval: string;
|
|
6406
|
-
limit:
|
|
6406
|
+
limit: number;
|
|
6407
6407
|
}, {
|
|
6408
6408
|
symbol: string;
|
|
6409
6409
|
from: string;
|
|
6410
6410
|
to: string;
|
|
6411
6411
|
interval: string;
|
|
6412
|
-
limit?:
|
|
6412
|
+
limit?: number | undefined;
|
|
6413
6413
|
}>;
|
|
6414
6414
|
declare type GetOHLCV = z.infer<typeof getOhlcvParser>;
|
|
6415
6415
|
declare const getOhlcvResponseParser: z.ZodObject<{
|
|
@@ -6598,20 +6598,20 @@ declare type OrderHistory = z.infer<typeof orderHistoryParser>;
|
|
|
6598
6598
|
declare const getOpenOrdersParser: z.ZodObject<{
|
|
6599
6599
|
account: z.ZodString;
|
|
6600
6600
|
symbol: z.ZodOptional<z.ZodString>;
|
|
6601
|
-
offset: z.ZodDefault<z.
|
|
6602
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6601
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
6602
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6603
6603
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
6604
6604
|
}, "strip", z.ZodTypeAny, {
|
|
6605
6605
|
account: string;
|
|
6606
|
-
limit:
|
|
6607
|
-
offset:
|
|
6606
|
+
limit: number;
|
|
6607
|
+
offset: number;
|
|
6608
6608
|
symbol?: string | undefined;
|
|
6609
6609
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6610
6610
|
}, {
|
|
6611
6611
|
account: string;
|
|
6612
6612
|
symbol?: string | undefined;
|
|
6613
|
-
offset?:
|
|
6614
|
-
limit?:
|
|
6613
|
+
offset?: number | undefined;
|
|
6614
|
+
limit?: number | undefined;
|
|
6615
6615
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6616
6616
|
}>;
|
|
6617
6617
|
declare type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
|
|
@@ -6727,15 +6727,15 @@ declare type GetOpenOrdersResponse = z.infer<typeof getOpenOrdersResponseParser>
|
|
|
6727
6727
|
declare const getOrderHistoryParser: z.ZodObject<{
|
|
6728
6728
|
account: z.ZodString;
|
|
6729
6729
|
symbol: z.ZodOptional<z.ZodString>;
|
|
6730
|
-
offset: z.ZodDefault<z.
|
|
6731
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6730
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
6731
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6732
6732
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
6733
6733
|
trx_id: z.ZodOptional<z.ZodString>;
|
|
6734
6734
|
status: z.ZodOptional<z.ZodString>;
|
|
6735
6735
|
}, "strip", z.ZodTypeAny, {
|
|
6736
6736
|
account: string;
|
|
6737
|
-
limit:
|
|
6738
|
-
offset:
|
|
6737
|
+
limit: number;
|
|
6738
|
+
offset: number;
|
|
6739
6739
|
symbol?: string | undefined;
|
|
6740
6740
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6741
6741
|
trx_id?: string | undefined;
|
|
@@ -6743,8 +6743,8 @@ declare const getOrderHistoryParser: z.ZodObject<{
|
|
|
6743
6743
|
}, {
|
|
6744
6744
|
account: string;
|
|
6745
6745
|
symbol?: string | undefined;
|
|
6746
|
-
offset?:
|
|
6747
|
-
limit?:
|
|
6746
|
+
offset?: number | undefined;
|
|
6747
|
+
limit?: number | undefined;
|
|
6748
6748
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6749
6749
|
trx_id?: string | undefined;
|
|
6750
6750
|
status?: string | undefined;
|
|
@@ -7198,15 +7198,15 @@ declare type Depth = z.infer<typeof depthParser>;
|
|
|
7198
7198
|
declare const getDepthParser: z.ZodObject<{
|
|
7199
7199
|
symbol: z.ZodString;
|
|
7200
7200
|
step: z.ZodString;
|
|
7201
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7201
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7202
7202
|
}, "strip", z.ZodTypeAny, {
|
|
7203
7203
|
symbol: string;
|
|
7204
|
-
limit:
|
|
7204
|
+
limit: number;
|
|
7205
7205
|
step: string;
|
|
7206
7206
|
}, {
|
|
7207
7207
|
symbol: string;
|
|
7208
7208
|
step: string;
|
|
7209
|
-
limit?:
|
|
7209
|
+
limit?: number | undefined;
|
|
7210
7210
|
}>;
|
|
7211
7211
|
declare type GetDepth = z.infer<typeof getDepthParser>;
|
|
7212
7212
|
declare const getDepthResponseParser: z.ZodObject<{
|
|
@@ -7737,16 +7737,16 @@ declare const tradeParser: z.ZodObject<{
|
|
|
7737
7737
|
declare type Trade = z.infer<typeof tradeParser>;
|
|
7738
7738
|
declare const getTradesParser: z.ZodObject<{
|
|
7739
7739
|
symbol: z.ZodString;
|
|
7740
|
-
offset: z.ZodDefault<z.
|
|
7741
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7740
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7741
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7742
7742
|
}, "strip", z.ZodTypeAny, {
|
|
7743
7743
|
symbol: string;
|
|
7744
|
-
limit:
|
|
7745
|
-
offset:
|
|
7744
|
+
limit: number;
|
|
7745
|
+
offset: number;
|
|
7746
7746
|
}, {
|
|
7747
7747
|
symbol: string;
|
|
7748
|
-
offset?:
|
|
7749
|
-
limit?:
|
|
7748
|
+
offset?: number | undefined;
|
|
7749
|
+
limit?: number | undefined;
|
|
7750
7750
|
}>;
|
|
7751
7751
|
declare type GetTrades = z.infer<typeof getTradesParser>;
|
|
7752
7752
|
declare const getTradesResponseParser: z.ZodObject<{
|
|
@@ -7883,21 +7883,21 @@ declare type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>;
|
|
|
7883
7883
|
declare const getTradeHistoryParser: z.ZodObject<{
|
|
7884
7884
|
account: z.ZodString;
|
|
7885
7885
|
symbol: z.ZodOptional<z.ZodString>;
|
|
7886
|
-
offset: z.ZodDefault<z.
|
|
7886
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7887
7887
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
7888
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7888
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7889
7889
|
}, "strip", z.ZodTypeAny, {
|
|
7890
7890
|
account: string;
|
|
7891
|
-
limit:
|
|
7892
|
-
offset:
|
|
7891
|
+
limit: number;
|
|
7892
|
+
offset: number;
|
|
7893
7893
|
symbol?: string | undefined;
|
|
7894
7894
|
ordinal_order_ids?: string | string[] | undefined;
|
|
7895
7895
|
}, {
|
|
7896
7896
|
account: string;
|
|
7897
7897
|
symbol?: string | undefined;
|
|
7898
|
-
offset?:
|
|
7898
|
+
offset?: number | undefined;
|
|
7899
7899
|
ordinal_order_ids?: string | string[] | undefined;
|
|
7900
|
-
limit?:
|
|
7900
|
+
limit?: number | undefined;
|
|
7901
7901
|
}>;
|
|
7902
7902
|
declare type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
|
|
7903
7903
|
declare const getTradeHistoryResponseParser: z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -1896,7 +1896,8 @@ var wrapParser = z10.object({
|
|
|
1896
1896
|
|
|
1897
1897
|
// src/parsers/dex.ts
|
|
1898
1898
|
var z11 = __toESM(require("zod"));
|
|
1899
|
-
var createLimit = (
|
|
1899
|
+
var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
1900
|
+
var createOffset = (base) => z11.coerce.number().default(base);
|
|
1900
1901
|
var ohlcvParser = z11.object({
|
|
1901
1902
|
time: z11.number(),
|
|
1902
1903
|
open: z11.number(),
|
|
@@ -1963,7 +1964,7 @@ var orderHistoryParser = z11.object({
|
|
|
1963
1964
|
var getOpenOrdersParser = z11.object({
|
|
1964
1965
|
account: z11.string(),
|
|
1965
1966
|
symbol: z11.string().optional(),
|
|
1966
|
-
offset:
|
|
1967
|
+
offset: createOffset(0),
|
|
1967
1968
|
limit: createLimit(100, 250),
|
|
1968
1969
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
|
|
1969
1970
|
});
|
|
@@ -1975,7 +1976,7 @@ var getOpenOrdersResponseParser = z11.object({
|
|
|
1975
1976
|
var getOrderHistoryParser = z11.object({
|
|
1976
1977
|
account: z11.string(),
|
|
1977
1978
|
symbol: z11.string().optional(),
|
|
1978
|
-
offset:
|
|
1979
|
+
offset: createOffset(0),
|
|
1979
1980
|
limit: createLimit(100, 250),
|
|
1980
1981
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
1981
1982
|
trx_id: z11.string().optional(),
|
|
@@ -2129,7 +2130,7 @@ var tradeParser = z11.object({
|
|
|
2129
2130
|
});
|
|
2130
2131
|
var getTradesParser = z11.object({
|
|
2131
2132
|
symbol: z11.string(),
|
|
2132
|
-
offset:
|
|
2133
|
+
offset: createOffset(0),
|
|
2133
2134
|
limit: createLimit(100, 250)
|
|
2134
2135
|
});
|
|
2135
2136
|
var getTradesResponseParser = z11.object({
|
|
@@ -2139,7 +2140,7 @@ var getTradesResponseParser = z11.object({
|
|
|
2139
2140
|
var getTradeHistoryParser = z11.object({
|
|
2140
2141
|
account: z11.string(),
|
|
2141
2142
|
symbol: z11.string().optional(),
|
|
2142
|
-
offset:
|
|
2143
|
+
offset: createOffset(0),
|
|
2143
2144
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
2144
2145
|
limit: createLimit(100, 250)
|
|
2145
2146
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1753,7 +1753,8 @@ var wrapParser = z10.object({
|
|
|
1753
1753
|
|
|
1754
1754
|
// src/parsers/dex.ts
|
|
1755
1755
|
import * as z11 from "zod";
|
|
1756
|
-
var createLimit = (
|
|
1756
|
+
var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
1757
|
+
var createOffset = (base) => z11.coerce.number().default(base);
|
|
1757
1758
|
var ohlcvParser = z11.object({
|
|
1758
1759
|
time: z11.number(),
|
|
1759
1760
|
open: z11.number(),
|
|
@@ -1820,7 +1821,7 @@ var orderHistoryParser = z11.object({
|
|
|
1820
1821
|
var getOpenOrdersParser = z11.object({
|
|
1821
1822
|
account: z11.string(),
|
|
1822
1823
|
symbol: z11.string().optional(),
|
|
1823
|
-
offset:
|
|
1824
|
+
offset: createOffset(0),
|
|
1824
1825
|
limit: createLimit(100, 250),
|
|
1825
1826
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
|
|
1826
1827
|
});
|
|
@@ -1832,7 +1833,7 @@ var getOpenOrdersResponseParser = z11.object({
|
|
|
1832
1833
|
var getOrderHistoryParser = z11.object({
|
|
1833
1834
|
account: z11.string(),
|
|
1834
1835
|
symbol: z11.string().optional(),
|
|
1835
|
-
offset:
|
|
1836
|
+
offset: createOffset(0),
|
|
1836
1837
|
limit: createLimit(100, 250),
|
|
1837
1838
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
1838
1839
|
trx_id: z11.string().optional(),
|
|
@@ -1986,7 +1987,7 @@ var tradeParser = z11.object({
|
|
|
1986
1987
|
});
|
|
1987
1988
|
var getTradesParser = z11.object({
|
|
1988
1989
|
symbol: z11.string(),
|
|
1989
|
-
offset:
|
|
1990
|
+
offset: createOffset(0),
|
|
1990
1991
|
limit: createLimit(100, 250)
|
|
1991
1992
|
});
|
|
1992
1993
|
var getTradesResponseParser = z11.object({
|
|
@@ -1996,7 +1997,7 @@ var getTradesResponseParser = z11.object({
|
|
|
1996
1997
|
var getTradeHistoryParser = z11.object({
|
|
1997
1998
|
account: z11.string(),
|
|
1998
1999
|
symbol: z11.string().optional(),
|
|
1999
|
-
offset:
|
|
2000
|
+
offset: createOffset(0),
|
|
2000
2001
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
2001
2002
|
limit: createLimit(100, 250)
|
|
2002
2003
|
});
|
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.122",
|
|
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": "412005a5fd9d671655384c5df74101922a1458cb"
|
|
44
44
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { accountRamDeltaParser, authorizationParser } from "./base";
|
|
3
3
|
|
|
4
|
-
const createLimit = (
|
|
5
|
-
z
|
|
6
|
-
.
|
|
7
|
-
.default(
|
|
4
|
+
const createLimit = (base: number, max: number) =>
|
|
5
|
+
z.coerce
|
|
6
|
+
.number()
|
|
7
|
+
.default(base)
|
|
8
8
|
.refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
9
9
|
|
|
10
|
+
const createOffset = (base: number) => z.coerce.number().default(base);
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* OHLCV
|
|
12
14
|
*/
|
|
@@ -89,7 +91,7 @@ export type OrderHistory = z.infer<typeof orderHistoryParser>;
|
|
|
89
91
|
export const getOpenOrdersParser = z.object({
|
|
90
92
|
account: z.string(),
|
|
91
93
|
symbol: z.string().optional(),
|
|
92
|
-
offset:
|
|
94
|
+
offset: createOffset(0),
|
|
93
95
|
limit: createLimit(100, 250),
|
|
94
96
|
ordinal_order_ids: z
|
|
95
97
|
.array(z.string())
|
|
@@ -108,7 +110,7 @@ export type GetOpenOrdersResponse = z.infer<typeof getOpenOrdersResponseParser>;
|
|
|
108
110
|
export const getOrderHistoryParser = z.object({
|
|
109
111
|
account: z.string(),
|
|
110
112
|
symbol: z.string().optional(),
|
|
111
|
-
offset:
|
|
113
|
+
offset: createOffset(0),
|
|
112
114
|
limit: createLimit(100, 250),
|
|
113
115
|
ordinal_order_ids: z
|
|
114
116
|
.array(z.string())
|
|
@@ -324,7 +326,7 @@ export type Trade = z.infer<typeof tradeParser>;
|
|
|
324
326
|
|
|
325
327
|
export const getTradesParser = z.object({
|
|
326
328
|
symbol: z.string(),
|
|
327
|
-
offset:
|
|
329
|
+
offset: createOffset(0),
|
|
328
330
|
limit: createLimit(100, 250),
|
|
329
331
|
});
|
|
330
332
|
export type GetTrades = z.infer<typeof getTradesParser>;
|
|
@@ -338,7 +340,7 @@ export type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>;
|
|
|
338
340
|
export const getTradeHistoryParser = z.object({
|
|
339
341
|
account: z.string(),
|
|
340
342
|
symbol: z.string().optional(),
|
|
341
|
-
offset:
|
|
343
|
+
offset: createOffset(0),
|
|
342
344
|
ordinal_order_ids: z
|
|
343
345
|
.array(z.string())
|
|
344
346
|
.or(z.string())
|