@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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.1.0",
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
- "nestjs-zod": "^1.1.2"
42
+ "zod": "^3.17.10"
43
43
  },
44
44
  "resolutions": {
45
45
  "typescript": "4.5"
46
46
  },
47
- "gitHead": "4680fb63d5be48692d155a4036dca1dc3730b7d5"
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
- ? 'dextest21'
14
- : 'dex',
13
+ ? 'dex'
14
+ : 'dextest21',
15
15
  FEE_FACTOR,
16
16
  GOOGLE_MAPS_KEY: 'AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs',
17
17
  SWAP_URL: chain === 'proton'
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z';
1
+ import * as z from 'zod';
2
2
  import { accountParser, authorizationsParser } from './base'
3
3
 
4
4
  const actionParser = z.object({
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z';
1
+ import * as z from 'zod';
2
2
  import { accountParser } from './base'
3
3
  import { generateAuthParser } from './auth'
4
4
 
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z';
1
+ import * as z from 'zod';
2
2
  import { baseActionParser, singleActionTransactionParser } from './actions'
3
3
  import { authorizationParser } from './base'
4
4
  import { WRAP_CONTRACT, WRAP_AUTH_ACTION } from '../constants'
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
 
3
3
  export const accountParser = z.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/)
4
4
 
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
 
3
3
  export interface CurrencyStat {
4
4
  supply : string;
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
 
3
3
  export enum Type {
4
4
  RECEIVE = 'receive',
@@ -1,10 +1,9 @@
1
1
  import { ExtendedAsset, ExtendedSymbol } from '@bloks/numbers';
2
- import { createZodDto } from 'nestjs-zod';
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.string(),
60
- ask: z.string(),
61
- bid: z.string(),
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(),
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
 
3
3
  export const otcOrderResponseParser = z.object({
4
4
  success : z.boolean(),
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
  import { singleActionTransactionParser } from './actions'
3
3
  import { authorizationParser } from './base'
4
4
  import { WRAP_CONTRACT } from '../constants'
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
 
3
3
  export const withdrawHistoryMetalSwapParser = z.object({
4
4
  id : z.string(),
@@ -1,4 +1,4 @@
1
- import { z } from 'nestjs-zod/z'
1
+ import * as z from 'zod'
2
2
  import { ExtendedAssetParser } from './base'
3
3
 
4
4
  export enum Status {