@proton/wrap-constants 0.2.52 → 0.2.54
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 +144 -0
- package/dist/wrap-constants.cjs.development.js +67 -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 +66 -1
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/parsers/dex.ts +69 -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.54",
|
|
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": "34749a9b04275a1d2056323aeb540356acdc80f9"
|
|
48
48
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* OHLCV
|
|
5
|
+
*/
|
|
3
6
|
export const ohlcvParser = z.object({
|
|
4
7
|
time: z.number(),
|
|
5
8
|
open: z.number(),
|
|
@@ -27,6 +30,9 @@ export const getOhlcvResponseParser = z.object({
|
|
|
27
30
|
})
|
|
28
31
|
export type GetOHLCVResponse = z.infer<typeof getOhlcvResponseParser>
|
|
29
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Order History
|
|
35
|
+
*/
|
|
30
36
|
export const orderHistoryParser = z.object({
|
|
31
37
|
seq: z.number(),
|
|
32
38
|
block_num: z.number(),
|
|
@@ -62,6 +68,9 @@ export const getOrderHistoryResponseParser = z.object({
|
|
|
62
68
|
})
|
|
63
69
|
export type GetOrderHistoryResponse = z.infer<typeof getOrderHistoryResponseParser>
|
|
64
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Depth
|
|
73
|
+
*/
|
|
65
74
|
export const depthParser = z.object({
|
|
66
75
|
level: z.number(),
|
|
67
76
|
ask: z.number(),
|
|
@@ -86,6 +95,9 @@ export const getDepthResponseParser = z.object({
|
|
|
86
95
|
})
|
|
87
96
|
export type GetDepthResponse = z.infer<typeof getDepthResponseParser>
|
|
88
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Daily
|
|
100
|
+
*/
|
|
89
101
|
export const dailyParser = z.object({
|
|
90
102
|
market_id: z.number(),
|
|
91
103
|
first: z.number(),
|
|
@@ -102,6 +114,9 @@ export const getDailyResponseParser = z.object({
|
|
|
102
114
|
})
|
|
103
115
|
export type GetDailyResponseParser = z.infer<typeof getDailyResponseParser>
|
|
104
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Markets
|
|
119
|
+
*/
|
|
105
120
|
export const marketParser = z.object({
|
|
106
121
|
market_id: z.number(),
|
|
107
122
|
symbol: z.string(),
|
|
@@ -131,6 +146,9 @@ export const getMarketsResponseParser = z.object({
|
|
|
131
146
|
})
|
|
132
147
|
export type GetMarketsResponse = z.infer<typeof getMarketsResponseParser>
|
|
133
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Trades
|
|
151
|
+
*/
|
|
134
152
|
export const tradeParser = z.object({
|
|
135
153
|
block_num: z.number(),
|
|
136
154
|
block_time: z.string(),
|
|
@@ -165,6 +183,9 @@ export const getTradesResponseParser = z.object({
|
|
|
165
183
|
})
|
|
166
184
|
export type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>
|
|
167
185
|
|
|
186
|
+
/**
|
|
187
|
+
* SYNC
|
|
188
|
+
*/
|
|
168
189
|
export const syncParser = z.object({
|
|
169
190
|
sourceid: z.number(),
|
|
170
191
|
block_num: z.string(),
|
|
@@ -182,6 +203,54 @@ export const getSyncResponseParser = z.object({
|
|
|
182
203
|
})
|
|
183
204
|
export type GetSyncResponse = z.infer<typeof getSyncResponseParser>
|
|
184
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Referral Totals
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
export const refferalTotalParser = z.object({
|
|
211
|
+
referrer: z.string(),
|
|
212
|
+
market_id: z.number(),
|
|
213
|
+
bid_fee: z.number(),
|
|
214
|
+
bid_total: z.number(),
|
|
215
|
+
ask_fee: z.number(),
|
|
216
|
+
ask_total: z.number(),
|
|
217
|
+
})
|
|
218
|
+
export type ReferralTotal = z.infer<typeof refferalTotalParser>
|
|
219
|
+
|
|
220
|
+
export const getReferralTotalsParser = z.object({
|
|
221
|
+
referrer: z.string()
|
|
222
|
+
})
|
|
223
|
+
export type GetReferralTotals = z.infer<typeof getReferralTotalsParser>
|
|
224
|
+
|
|
225
|
+
export const getReferralTotalsResponseParser = z.object({
|
|
226
|
+
sync: z.number(),
|
|
227
|
+
data: z.array(refferalTotalParser)
|
|
228
|
+
})
|
|
229
|
+
export type GetReferralTotalsResponseParser = z.infer<typeof getReferralTotalsResponseParser>
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Referrals
|
|
233
|
+
*/
|
|
234
|
+
export const refferalParser = z.object({
|
|
235
|
+
referred_user: z.string(),
|
|
236
|
+
})
|
|
237
|
+
export type Referral = z.infer<typeof refferalParser>
|
|
238
|
+
|
|
239
|
+
export const getReferralsParser = z.object({
|
|
240
|
+
referrer: z.string()
|
|
241
|
+
})
|
|
242
|
+
export type GetReferrals = z.infer<typeof getReferralsParser>
|
|
243
|
+
|
|
244
|
+
export const getReferralsResponseParser = z.object({
|
|
245
|
+
sync: z.number(),
|
|
246
|
+
data: z.array(refferalParser)
|
|
247
|
+
})
|
|
248
|
+
export type GetReferralsResponseParser = z.infer<typeof getReferralsResponseParser>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Basic Types
|
|
253
|
+
*/
|
|
185
254
|
export enum orderType { ORDERBOOK = 0, LIMIT = 1, STOPLOSS = 2, TAKEPROFIT = 3 }
|
|
186
255
|
|
|
187
256
|
export enum orderSide { INVALID = 0, BUY = 1, SELL = 2 }
|