@proton/wrap-constants 0.1.0 → 0.2.1
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/actions.d.ts +1 -1
- package/dist/parsers/address.d.ts +1 -1
- package/dist/parsers/auth.d.ts +1 -1
- package/dist/parsers/base.d.ts +1 -1
- package/dist/parsers/currency.d.ts +1 -1
- package/dist/parsers/deposit.d.ts +1 -1
- package/dist/parsers/dex.d.ts +14 -230
- package/dist/parsers/otc.d.ts +1 -1
- package/dist/parsers/withdraw.d.ts +1 -1
- package/dist/parsers/withdrawalHistory.d.ts +1 -1
- package/dist/parsers/wrap.d.ts +1 -1
- package/dist/wrap-constants.cjs.development.js +226 -345
- 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 +223 -338
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/coins.ts +15 -1
- package/src/constants.ts +2 -2
- package/src/parsers/actions.ts +1 -1
- package/src/parsers/address.ts +1 -1
- package/src/parsers/auth.ts +1 -1
- package/src/parsers/base.ts +1 -1
- package/src/parsers/currency.ts +1 -1
- package/src/parsers/deposit.ts +1 -1
- package/src/parsers/dex.ts +8 -18
- package/src/parsers/otc.ts +1 -1
- package/src/parsers/withdraw.ts +1 -1
- package/src/parsers/withdrawalHistory.ts +1 -1
- package/src/parsers/wrap.ts +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.1
|
|
8
|
+
"version": "0.2.1",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"lodash.clonedeep": "^4.5.0",
|
|
42
|
-
"
|
|
42
|
+
"zod": "^3.17.10"
|
|
43
43
|
},
|
|
44
44
|
"resolutions": {
|
|
45
45
|
"typescript": "4.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a00d331cd2b03c582049181340e3f2f32b930a9a"
|
|
48
48
|
}
|
package/src/coins.ts
CHANGED
|
@@ -224,7 +224,7 @@ export const initializeCoins = (protonChain: string): {
|
|
|
224
224
|
allowBridge: IS_MAINNET,
|
|
225
225
|
allowLend: true,
|
|
226
226
|
allowBorrow: true,
|
|
227
|
-
name: 'Metal',
|
|
227
|
+
name: 'Metal DAO',
|
|
228
228
|
coin: 'MTL',
|
|
229
229
|
xtokenSymbol: 'XMT',
|
|
230
230
|
xtokenPrecision: 8,
|
|
@@ -243,6 +243,20 @@ export const initializeCoins = (protonChain: string): {
|
|
|
243
243
|
image: 'https://www.proton.org/images/tokens/xtokensXMT.png',
|
|
244
244
|
coingeckoId: 'metal'
|
|
245
245
|
},
|
|
246
|
+
{
|
|
247
|
+
allowSwap: IS_MAINNET,
|
|
248
|
+
allowBridge: false,
|
|
249
|
+
allowLend: false,
|
|
250
|
+
allowBorrow: false,
|
|
251
|
+
name: 'Metal Blockchain',
|
|
252
|
+
coin: 'METAL',
|
|
253
|
+
xtokenSymbol: 'METAL',
|
|
254
|
+
xtokenPrecision: 8,
|
|
255
|
+
xtokenContract: 'xtokens',
|
|
256
|
+
wallets: [],
|
|
257
|
+
image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/metal-chain.png',
|
|
258
|
+
coingeckoId: ''
|
|
259
|
+
},
|
|
246
260
|
{
|
|
247
261
|
allowSwap: true,
|
|
248
262
|
allowBridge: true,
|
package/src/constants.ts
CHANGED
|
@@ -10,8 +10,8 @@ export const initializeConstants = (chain: string) => {
|
|
|
10
10
|
const constants = {
|
|
11
11
|
SWAP_CONTRACT: 'proton.swaps',
|
|
12
12
|
DEX_CONTRACT: chain === 'proton'
|
|
13
|
-
? '
|
|
14
|
-
: '
|
|
13
|
+
? 'dex'
|
|
14
|
+
: 'dextest21',
|
|
15
15
|
FEE_FACTOR,
|
|
16
16
|
GOOGLE_MAPS_KEY: 'AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs',
|
|
17
17
|
SWAP_URL: chain === 'proton'
|
package/src/parsers/actions.ts
CHANGED
package/src/parsers/address.ts
CHANGED
package/src/parsers/auth.ts
CHANGED
package/src/parsers/base.ts
CHANGED
package/src/parsers/currency.ts
CHANGED
package/src/parsers/deposit.ts
CHANGED
package/src/parsers/dex.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ExtendedAsset, ExtendedSymbol } from '@bloks/numbers';
|
|
2
|
-
import
|
|
3
|
-
import { z } from 'nestjs-zod/z';
|
|
2
|
+
import * as z from 'zod';
|
|
4
3
|
|
|
5
4
|
const numTransform = z.string().regex(/\d+/).transform(Number)
|
|
6
5
|
|
|
7
|
-
const ohlcvParser = z.object({
|
|
6
|
+
export const ohlcvParser = z.object({
|
|
8
7
|
time: z.number(),
|
|
9
8
|
open: z.number(),
|
|
10
9
|
high: z.number(),
|
|
@@ -15,9 +14,8 @@ const ohlcvParser = z.object({
|
|
|
15
14
|
count: z.number()
|
|
16
15
|
})
|
|
17
16
|
export type OHLCV = z.infer<typeof ohlcvParser>
|
|
18
|
-
export class OHLCV_DTO extends createZodDto(ohlcvParser) {}
|
|
19
17
|
|
|
20
|
-
const getOhlcvParser = z.object({
|
|
18
|
+
export const getOhlcvParser = z.object({
|
|
21
19
|
interval: z.string(),
|
|
22
20
|
dateFrom: z.string(),
|
|
23
21
|
dateTo: z.string(),
|
|
@@ -25,9 +23,8 @@ const getOhlcvParser = z.object({
|
|
|
25
23
|
limit: z.number().or(numTransform).default(500).refine(n => n <= 1000, 'Max limit is 1000'),
|
|
26
24
|
})
|
|
27
25
|
export type GetOHLCV = z.infer<typeof getOhlcvParser>
|
|
28
|
-
export class GetOHLCV_DTO extends createZodDto(getOhlcvParser) {}
|
|
29
26
|
|
|
30
|
-
const orderHistoryParser = z.object({
|
|
27
|
+
export const orderHistoryParser = z.object({
|
|
31
28
|
seq: z.number(),
|
|
32
29
|
block_num: z.number(),
|
|
33
30
|
block_time: z.string(),
|
|
@@ -44,25 +41,21 @@ const orderHistoryParser = z.object({
|
|
|
44
41
|
trx_id: z.string(),
|
|
45
42
|
})
|
|
46
43
|
export type OrderHistory = z.infer<typeof orderHistoryParser>
|
|
47
|
-
export class OrderHistory_DTO extends createZodDto(orderHistoryParser) {}
|
|
48
44
|
|
|
49
|
-
const getOrderHistoryParser = z.object({
|
|
45
|
+
export const getOrderHistoryParser = z.object({
|
|
50
46
|
account: z.string(),
|
|
51
47
|
offset: z.number().or(numTransform).default(0),
|
|
52
48
|
limit: z.number().or(numTransform).default(100).refine(n => n <= 250, 'Max limit is 250'),
|
|
53
49
|
})
|
|
54
50
|
export type GetOrderHistory = z.infer<typeof getOrderHistoryParser>
|
|
55
|
-
export class GetOrderHistory_DTO extends createZodDto(getOrderHistoryParser) {}
|
|
56
|
-
|
|
57
51
|
|
|
58
52
|
const depthParser = z.object({
|
|
59
|
-
level: z.
|
|
60
|
-
ask: z.
|
|
61
|
-
bid: z.
|
|
53
|
+
level: z.number(),
|
|
54
|
+
ask: z.number(),
|
|
55
|
+
bid: z.number(),
|
|
62
56
|
count: z.number(),
|
|
63
57
|
})
|
|
64
58
|
export type Depth = z.infer<typeof depthParser>
|
|
65
|
-
export class Depth_DTO extends createZodDto(depthParser) {}
|
|
66
59
|
|
|
67
60
|
const getDepthParser = z.object({
|
|
68
61
|
marketId: z.number(),
|
|
@@ -71,7 +64,6 @@ const getDepthParser = z.object({
|
|
|
71
64
|
limit: z.number().or(numTransform).default(100).refine(n => n <= 250, 'Max limit is 250'),
|
|
72
65
|
})
|
|
73
66
|
export type GetDepth = z.infer<typeof getDepthParser>
|
|
74
|
-
export class GetDepth_DTO extends createZodDto(getDepthParser) {}
|
|
75
67
|
|
|
76
68
|
const tradeParser = z.object({
|
|
77
69
|
block_num: z.number(),
|
|
@@ -91,7 +83,6 @@ const tradeParser = z.object({
|
|
|
91
83
|
trx_id: z.string(),
|
|
92
84
|
})
|
|
93
85
|
export type Trade = z.infer<typeof tradeParser>
|
|
94
|
-
export class Trade_DTO extends createZodDto(tradeParser) {}
|
|
95
86
|
|
|
96
87
|
const getTradesParser = z.object({
|
|
97
88
|
marketId: z.number().or(numTransform),
|
|
@@ -100,7 +91,6 @@ const getTradesParser = z.object({
|
|
|
100
91
|
})
|
|
101
92
|
|
|
102
93
|
export type GetTrades = z.infer<typeof getTradesParser>
|
|
103
|
-
export class GetTrades_DTO extends createZodDto(getTradesParser) {}
|
|
104
94
|
|
|
105
95
|
const syncParser = z.object({
|
|
106
96
|
sourceid: z.number(),
|
package/src/parsers/otc.ts
CHANGED
package/src/parsers/withdraw.ts
CHANGED
package/src/parsers/wrap.ts
CHANGED