@proton/wrap-constants 0.0.85 → 0.1.0

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.
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
- var z = require('zod');
7
+ var z = require('nestjs-zod/z');
8
+ var nestjsZod = require('nestjs-zod');
8
9
  var cloneDeep = _interopDefault(require('lodash.clonedeep'));
9
10
  var bignumber_js = require('bignumber.js');
10
11
 
@@ -199,7 +200,7 @@ var initializeCoins = function initializeCoins(protonChain) {
199
200
  allowBridge: IS_MAINNET,
200
201
  allowLend: true,
201
202
  allowBorrow: true,
202
- name: 'Metal DAO',
203
+ name: 'Metal',
203
204
  coin: 'MTL',
204
205
  xtokenSymbol: 'XMT',
205
206
  xtokenPrecision: 8,
@@ -215,19 +216,6 @@ var initializeCoins = function initializeCoins(protonChain) {
215
216
  }] : []),
216
217
  image: 'https://www.proton.org/images/tokens/xtokensXMT.png',
217
218
  coingeckoId: 'metal'
218
- }, {
219
- allowSwap: IS_MAINNET,
220
- allowBridge: false,
221
- allowLend: false,
222
- allowBorrow: false,
223
- name: 'Metal Chain',
224
- coin: 'METAL',
225
- xtokenSymbol: 'METAL',
226
- xtokenPrecision: 8,
227
- xtokenContract: 'xtokens',
228
- wallets: [],
229
- image: 'https://raw.githubusercontent.com/eoscafe/eos-airdrops/master/logos/metal-chain.png',
230
- coingeckoId: ''
231
219
  }, {
232
220
  allowSwap: true,
233
221
  allowBridge: true,
@@ -936,77 +924,77 @@ var initializeCoins = function initializeCoins(protonChain) {
936
924
  };
937
925
  };
938
926
 
939
- var accountParser = /*#__PURE__*/z.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
940
- var authorizationParser = /*#__PURE__*/z.object({
927
+ var accountParser = /*#__PURE__*/z.z.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
928
+ var authorizationParser = /*#__PURE__*/z.z.object({
941
929
  actor: accountParser,
942
- permission: /*#__PURE__*/z.string()
930
+ permission: /*#__PURE__*/z.z.string()
943
931
  });
944
- var authorizationsParser = /*#__PURE__*/z.array(authorizationParser).min(1);
945
- var ExtendedAssetParser = /*#__PURE__*/z.object({
946
- quantity: /*#__PURE__*/z.string(),
932
+ var authorizationsParser = /*#__PURE__*/z.z.array(authorizationParser).min(1);
933
+ var ExtendedAssetParser = /*#__PURE__*/z.z.object({
934
+ quantity: /*#__PURE__*/z.z.string(),
947
935
  contract: accountParser
948
936
  });
949
937
 
950
- var actionParser = /*#__PURE__*/z.object({
951
- account: /*#__PURE__*/z.string(),
952
- name: /*#__PURE__*/z.string(),
953
- authorization: /*#__PURE__*/z.array( /*#__PURE__*/z.object({
954
- actor: /*#__PURE__*/z.string(),
955
- permission: /*#__PURE__*/z.string()
938
+ var actionParser = /*#__PURE__*/z.z.object({
939
+ account: /*#__PURE__*/z.z.string(),
940
+ name: /*#__PURE__*/z.z.string(),
941
+ authorization: /*#__PURE__*/z.z.array( /*#__PURE__*/z.z.object({
942
+ actor: /*#__PURE__*/z.z.string(),
943
+ permission: /*#__PURE__*/z.z.string()
956
944
  })),
957
- data: /*#__PURE__*/z.any(),
958
- hex_data: /*#__PURE__*/z.string().optional()
945
+ data: /*#__PURE__*/z.z.any(),
946
+ hex_data: /*#__PURE__*/z.z.string().optional()
959
947
  });
960
- var transactionExtensionsParser = /*#__PURE__*/z.array(z.number().or(z.string())).optional();
961
- var rawTransactionParser = /*#__PURE__*/z.object({
962
- expiration: /*#__PURE__*/z.string(),
963
- ref_block_num: /*#__PURE__*/z.number(),
964
- ref_block_prefix: /*#__PURE__*/z.number(),
965
- max_net_usage_words: /*#__PURE__*/z.number(),
966
- max_cpu_usage_ms: /*#__PURE__*/z.number(),
967
- delay_sec: /*#__PURE__*/z.number(),
968
- context_free_actions: /*#__PURE__*/z.array(actionParser),
969
- transaction_extensions: /*#__PURE__*/z.array(transactionExtensionsParser)
948
+ var transactionExtensionsParser = /*#__PURE__*/z.z.array(z.z.number().or(z.z.string())).optional();
949
+ var rawTransactionParser = /*#__PURE__*/z.z.object({
950
+ expiration: /*#__PURE__*/z.z.string(),
951
+ ref_block_num: /*#__PURE__*/z.z.number(),
952
+ ref_block_prefix: /*#__PURE__*/z.z.number(),
953
+ max_net_usage_words: /*#__PURE__*/z.z.number(),
954
+ max_cpu_usage_ms: /*#__PURE__*/z.z.number(),
955
+ delay_sec: /*#__PURE__*/z.z.number(),
956
+ context_free_actions: /*#__PURE__*/z.z.array(actionParser),
957
+ transaction_extensions: /*#__PURE__*/z.z.array(transactionExtensionsParser)
970
958
  });
971
959
  var baseActionParser = function baseActionParser(contract, action, data) {
972
- return z.object({
973
- account: contract === '*' ? accountParser : z.literal(contract),
974
- name: z.literal(action),
975
- data: z.object(data),
960
+ return z.z.object({
961
+ account: contract === '*' ? accountParser : z.z.literal(contract),
962
+ name: z.z.literal(action),
963
+ data: z.z.object(data),
976
964
  authorization: authorizationsParser
977
965
  });
978
966
  };
979
967
  var baseActionSerializedParser = function baseActionSerializedParser(contract, action, data) {
980
- return z.object({
981
- account: contract === '*' ? accountParser : z.literal(contract),
982
- name: z.literal(action),
983
- data: z.string().or(z.object(data)),
968
+ return z.z.object({
969
+ account: contract === '*' ? accountParser : z.z.literal(contract),
970
+ name: z.z.literal(action),
971
+ data: z.z.string().or(z.z.object(data)),
984
972
  authorization: authorizationsParser
985
973
  });
986
974
  };
987
975
  var webauthActionParser = function webauthActionParser(contract, action, data) {
988
- return z.object({
989
- account: z.literal('webauthn'),
990
- name: z.literal('exec'),
991
- data: z.object({
976
+ return z.z.object({
977
+ account: z.z.literal('webauthn'),
978
+ name: z.z.literal('exec'),
979
+ data: z.z.object({
992
980
  account: accountParser,
993
- key: z.object({
994
- key: z.array(z.string().or(z.object({
995
- modulus: z.string(),
996
- exponent: z.string()
981
+ key: z.z.object({
982
+ key: z.z.array(z.z.string().or(z.z.object({
983
+ modulus: z.z.string(),
984
+ exponent: z.z.string()
997
985
  }))),
998
- user_presence: z.number(),
999
- rpid: z.string()
986
+ user_presence: z.z.number(),
987
+ rpid: z.z.string()
1000
988
  }),
1001
- nonce: z.number(),
989
+ nonce: z.z.number(),
1002
990
  permissions: authorizationsParser,
1003
- signature: z.object({
1004
- auth_data: z.string(),
1005
- client_json: z.string(),
1006
- signature: z.string()
991
+ signature: z.z.object({
992
+ auth_data: z.z.string(),
993
+ client_json: z.z.string(),
994
+ signature: z.z.string()
1007
995
  }),
1008
- trx: rawTransactionParser.merge(z.object({
1009
- actions: z.array(baseActionSerializedParser(contract, action, data)).length(1)
996
+ trx: rawTransactionParser.merge(z.z.object({
997
+ actions: z.z.array(baseActionSerializedParser(contract, action, data)).length(1)
1010
998
  }))
1011
999
  }),
1012
1000
  authorization: authorizationsParser
@@ -1015,8 +1003,8 @@ var webauthActionParser = function webauthActionParser(contract, action, data) {
1015
1003
  var singleActionTransactionParser = function singleActionTransactionParser(contract, action, data) {
1016
1004
  var baseAction = baseActionParser(contract, action, data);
1017
1005
  var webauthAction = webauthActionParser(contract, action, data);
1018
- return rawTransactionParser.merge(z.object({
1019
- actions: z.array(baseAction.or(webauthAction)).length(1)
1006
+ return rawTransactionParser.merge(z.z.object({
1007
+ actions: z.z.array(baseAction.or(webauthAction)).length(1)
1020
1008
  }));
1021
1009
  };
1022
1010
 
@@ -1038,6 +1026,22 @@ function _extends() {
1038
1026
  return _extends.apply(this, arguments);
1039
1027
  }
1040
1028
 
1029
+ function _inheritsLoose(subClass, superClass) {
1030
+ subClass.prototype = Object.create(superClass.prototype);
1031
+ subClass.prototype.constructor = subClass;
1032
+
1033
+ _setPrototypeOf(subClass, superClass);
1034
+ }
1035
+
1036
+ function _setPrototypeOf(o, p) {
1037
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
1038
+ o.__proto__ = p;
1039
+ return o;
1040
+ };
1041
+
1042
+ return _setPrototypeOf(o, p);
1043
+ }
1044
+
1041
1045
  function _unsupportedIterableToArray(o, minLen) {
1042
1046
  if (!o) return;
1043
1047
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -1091,6 +1095,7 @@ var initializeConstants = function initializeConstants(chain) {
1091
1095
 
1092
1096
  var constants = {
1093
1097
  SWAP_CONTRACT: 'proton.swaps',
1098
+ DEX_CONTRACT: chain === 'proton' ? 'dextest21' : 'dex',
1094
1099
  FEE_FACTOR: FEE_FACTOR,
1095
1100
  GOOGLE_MAPS_KEY: 'AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs',
1096
1101
  SWAP_URL: chain === 'proton' ? 'https://otc.protonswap.com' : 'https://otc-test.protonswap.com',
@@ -1125,7 +1130,8 @@ var initializeConstants = function initializeConstants(chain) {
1125
1130
  WRAP_AUTH_ACTION: WRAP_AUTH_ACTION,
1126
1131
  METAL_ENDPOINT: chain === 'proton' ? 'https://cirrus.metalpay.com' : 'https://cirrus-dev.metalpay.com',
1127
1132
  METAL_PROTON_ENDPOINT: chain === 'proton' ? 'https://api.protonchain.com' : 'https://api-dev.protonchain.com',
1128
- PROTON_ENDPOINTS: chain === 'proton' ? ['https://proton.greymass.com', 'https://proton.eoscafeblock.com', 'https://proton.cryptolions.io', 'https://proton.eosusa.news'] : ['https://testnet.protonchain.com'],
1133
+ METAL_DEX_ENDPOINT: chain === 'proton' ? 'https://metallicus-dbapi-dev01.binfra.one' : 'https://metallicus-dbapi-dev01.binfra.one',
1134
+ PROTON_ENDPOINTS: chain === 'proton' ? ['https://metal-proton-rpc.global.binfra.one', 'https://proton.greymass.com', 'https://proton.eoscafeblock.com', 'https://proton.cryptolions.io', 'https://proton.eosusa.news'] : ['https://metal-protontest-rpc.global.binfra.one', 'https://testnet.protonchain.com'],
1129
1135
  CHAIN_ID: chain === 'proton' ? '384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0' : '71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd',
1130
1136
  CHAIN: chain,
1131
1137
  SWAP_COINS: swapCoins,
@@ -1173,57 +1179,57 @@ var initializeConstants = function initializeConstants(chain) {
1173
1179
  };
1174
1180
 
1175
1181
  var createAbstractAuthParser = function createAbstractAuthParser(contract, action, data) {
1176
- return z.object({
1182
+ return z.z.object({
1177
1183
  signer: authorizationParser,
1178
- signatures: z.array(z.string()).length(1),
1184
+ signatures: z.z.array(z.z.string()).length(1),
1179
1185
  transaction: singleActionTransactionParser(contract, action, data)
1180
1186
  });
1181
1187
  };
1182
1188
  var generateAuthData = {
1183
- time: /*#__PURE__*/z.string(),
1184
- protonAccount: /*#__PURE__*/z.string()
1189
+ time: /*#__PURE__*/z.z.string(),
1190
+ protonAccount: /*#__PURE__*/z.z.string()
1185
1191
  };
1186
1192
  var generateAuthParser = /*#__PURE__*/createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
1187
1193
 
1188
- var addressParser = /*#__PURE__*/z.object({
1189
- index: /*#__PURE__*/z.number(),
1194
+ var addressParser = /*#__PURE__*/z.z.object({
1195
+ index: /*#__PURE__*/z.z.number(),
1190
1196
  account: accountParser,
1191
- chain: /*#__PURE__*/z.string(),
1192
- address: /*#__PURE__*/z.string(),
1193
- address_hash: /*#__PURE__*/z.string()
1197
+ chain: /*#__PURE__*/z.z.string(),
1198
+ address: /*#__PURE__*/z.z.string(),
1199
+ address_hash: /*#__PURE__*/z.z.string()
1194
1200
  });
1195
- var generateAddressBodyParser = /*#__PURE__*/z.object({
1196
- coin: z.string(),
1197
- wallet: z.string()
1201
+ var generateAddressBodyParser = /*#__PURE__*/z.z.object({
1202
+ coin: z.z.string(),
1203
+ wallet: z.z.string()
1198
1204
  }).merge(generateAuthParser);
1199
- var generateAddressResponse = /*#__PURE__*/z.object({
1200
- id: /*#__PURE__*/z.string(),
1201
- address: /*#__PURE__*/z.string(),
1202
- coin: /*#__PURE__*/z.string(),
1203
- wallet: /*#__PURE__*/z.string(),
1204
- memo: /*#__PURE__*/z.string().optional()
1205
+ var generateAddressResponse = /*#__PURE__*/z.z.object({
1206
+ id: /*#__PURE__*/z.z.string(),
1207
+ address: /*#__PURE__*/z.z.string(),
1208
+ coin: /*#__PURE__*/z.z.string(),
1209
+ wallet: /*#__PURE__*/z.z.string(),
1210
+ memo: /*#__PURE__*/z.z.string().optional()
1205
1211
  });
1206
1212
 
1207
- var rateParser = /*#__PURE__*/z.object({
1208
- counterCurrency: /*#__PURE__*/z.string(),
1209
- price: /*#__PURE__*/z.number(),
1210
- priceChangePercent: /*#__PURE__*/z.number(),
1211
- marketCap: /*#__PURE__*/z.number(),
1212
- volume: /*#__PURE__*/z.number(),
1213
- timestamp: /*#__PURE__*/z.number()
1213
+ var rateParser = /*#__PURE__*/z.z.object({
1214
+ counterCurrency: /*#__PURE__*/z.z.string(),
1215
+ price: /*#__PURE__*/z.z.number(),
1216
+ priceChangePercent: /*#__PURE__*/z.z.number(),
1217
+ marketCap: /*#__PURE__*/z.z.number(),
1218
+ volume: /*#__PURE__*/z.z.number(),
1219
+ timestamp: /*#__PURE__*/z.z.number()
1214
1220
  });
1215
- var exchangeRateParser = /*#__PURE__*/z.object({
1216
- contract: /*#__PURE__*/z.string(),
1217
- symbol: /*#__PURE__*/z.string(),
1218
- rank: /*#__PURE__*/z.number(),
1219
- rates: /*#__PURE__*/z.array(rateParser)
1221
+ var exchangeRateParser = /*#__PURE__*/z.z.object({
1222
+ contract: /*#__PURE__*/z.z.string(),
1223
+ symbol: /*#__PURE__*/z.z.string(),
1224
+ rank: /*#__PURE__*/z.z.number(),
1225
+ rates: /*#__PURE__*/z.z.array(rateParser)
1220
1226
  });
1221
- var exchangeRatesParser = /*#__PURE__*/z.array(exchangeRateParser);
1222
- var bloksRatesParser = /*#__PURE__*/z.array( /*#__PURE__*/z.object({
1223
- contract: /*#__PURE__*/z.string(),
1224
- symbol: /*#__PURE__*/z.string(),
1225
- rank: /*#__PURE__*/z.number(),
1226
- rates: /*#__PURE__*/z.array(rateParser)
1227
+ var exchangeRatesParser = /*#__PURE__*/z.z.array(exchangeRateParser);
1228
+ var bloksRatesParser = /*#__PURE__*/z.z.array( /*#__PURE__*/z.z.object({
1229
+ contract: /*#__PURE__*/z.z.string(),
1230
+ symbol: /*#__PURE__*/z.z.string(),
1231
+ rank: /*#__PURE__*/z.z.number(),
1232
+ rates: /*#__PURE__*/z.z.array(rateParser)
1227
1233
  }));
1228
1234
 
1229
1235
  (function (Type) {
@@ -1231,91 +1237,91 @@ var bloksRatesParser = /*#__PURE__*/z.array( /*#__PURE__*/z.object({
1231
1237
  Type["SEND"] = "send";
1232
1238
  })(exports.Type || (exports.Type = {}));
1233
1239
 
1234
- var depositBodyParser = /*#__PURE__*/z.object({
1235
- id: /*#__PURE__*/z.string(),
1236
- type: /*#__PURE__*/z.nativeEnum(exports.Type),
1237
- hash: /*#__PURE__*/z.string(),
1238
- coin: /*#__PURE__*/z.string(),
1239
- wallet: /*#__PURE__*/z.string() // "ETH-ROPSTEN" or "XPR-MAINNET"
1240
+ var depositBodyParser = /*#__PURE__*/z.z.object({
1241
+ id: /*#__PURE__*/z.z.string(),
1242
+ type: /*#__PURE__*/z.z.nativeEnum(exports.Type),
1243
+ hash: /*#__PURE__*/z.z.string(),
1244
+ coin: /*#__PURE__*/z.z.string(),
1245
+ wallet: /*#__PURE__*/z.z.string() // "ETH-ROPSTEN" or "XPR-MAINNET"
1240
1246
 
1241
1247
  });
1242
- var transactionParser = /*#__PURE__*/z.object({
1243
- id: /*#__PURE__*/z.string(),
1244
- wallet: /*#__PURE__*/z.string(),
1245
- value: /*#__PURE__*/z.number(),
1246
- valueString: /*#__PURE__*/z.string(),
1247
- address: /*#__PURE__*/z.string(),
1248
- type: /*#__PURE__*/z.nativeEnum(exports.Type),
1249
- state: /*#__PURE__*/z.string(),
1250
- confirmations: /*#__PURE__*/z.number(),
1251
- hash: /*#__PURE__*/z.string(),
1252
- blockHash: /*#__PURE__*/z.string().optional().nullable(),
1253
- blockHeight: /*#__PURE__*/z.number().optional().nullable() // 643159
1248
+ var transactionParser = /*#__PURE__*/z.z.object({
1249
+ id: /*#__PURE__*/z.z.string(),
1250
+ wallet: /*#__PURE__*/z.z.string(),
1251
+ value: /*#__PURE__*/z.z.number(),
1252
+ valueString: /*#__PURE__*/z.z.string(),
1253
+ address: /*#__PURE__*/z.z.string(),
1254
+ type: /*#__PURE__*/z.z.nativeEnum(exports.Type),
1255
+ state: /*#__PURE__*/z.z.string(),
1256
+ confirmations: /*#__PURE__*/z.z.number(),
1257
+ hash: /*#__PURE__*/z.z.string(),
1258
+ blockHash: /*#__PURE__*/z.z.string().optional().nullable(),
1259
+ blockHeight: /*#__PURE__*/z.z.number().optional().nullable() // 643159
1254
1260
 
1255
1261
  });
1256
1262
 
1257
- var otcOrderResponseParser = /*#__PURE__*/z.object({
1258
- success: /*#__PURE__*/z.boolean(),
1259
- transaction_id: /*#__PURE__*/z.string(),
1260
- errormsg: /*#__PURE__*/z.string().optional()
1263
+ var otcOrderResponseParser = /*#__PURE__*/z.z.object({
1264
+ success: /*#__PURE__*/z.z["boolean"](),
1265
+ transaction_id: /*#__PURE__*/z.z.string(),
1266
+ errormsg: /*#__PURE__*/z.z.string().optional()
1261
1267
  });
1262
- var otcQuoteBodyParser = /*#__PURE__*/z.object({
1263
- baseAmount: /*#__PURE__*/z.number(),
1264
- baseSymbol: /*#__PURE__*/z.string(),
1265
- quoteSymbol: /*#__PURE__*/z.string()
1268
+ var otcQuoteBodyParser = /*#__PURE__*/z.z.object({
1269
+ baseAmount: /*#__PURE__*/z.z.number(),
1270
+ baseSymbol: /*#__PURE__*/z.z.string(),
1271
+ quoteSymbol: /*#__PURE__*/z.z.string()
1266
1272
  });
1267
- var otcQuoteResponseParser = /*#__PURE__*/z.object({
1268
- success: /*#__PURE__*/z.boolean(),
1269
- token: /*#__PURE__*/z.string(),
1270
- qty: /*#__PURE__*/z.number(),
1271
- errormsg: /*#__PURE__*/z.string().optional()
1273
+ var otcQuoteResponseParser = /*#__PURE__*/z.z.object({
1274
+ success: /*#__PURE__*/z.z["boolean"](),
1275
+ token: /*#__PURE__*/z.z.string(),
1276
+ qty: /*#__PURE__*/z.z.number(),
1277
+ errormsg: /*#__PURE__*/z.z.string().optional()
1272
1278
  });
1273
1279
 
1274
1280
  var withdrawData = {
1275
- from: /*#__PURE__*/z.string().refine(function (val) {
1281
+ from: /*#__PURE__*/z.z.string().refine(function (val) {
1276
1282
  return val !== WRAP_CONTRACT;
1277
1283
  }, {
1278
1284
  message: WRAP_CONTRACT + " must be receiver"
1279
1285
  }),
1280
- to: /*#__PURE__*/z.literal(WRAP_CONTRACT),
1281
- quantity: /*#__PURE__*/z.string(),
1282
- memo: /*#__PURE__*/z.string()
1286
+ to: /*#__PURE__*/z.z.literal(WRAP_CONTRACT),
1287
+ quantity: /*#__PURE__*/z.z.string(),
1288
+ memo: /*#__PURE__*/z.z.string()
1283
1289
  };
1284
- var withdrawBodyParser = /*#__PURE__*/z.object({
1290
+ var withdrawBodyParser = /*#__PURE__*/z.z.object({
1285
1291
  signer: authorizationParser,
1286
- signatures: /*#__PURE__*/z.array(z.string()).length(1),
1292
+ signatures: /*#__PURE__*/z.z.array(z.z.string()).length(1),
1287
1293
  transaction: /*#__PURE__*/singleActionTransactionParser('*', 'transfer', withdrawData),
1288
- quoteId: /*#__PURE__*/z.string(),
1289
- provider: /*#__PURE__*/z.string().optional()
1294
+ quoteId: /*#__PURE__*/z.z.string(),
1295
+ provider: /*#__PURE__*/z.z.string().optional()
1290
1296
  });
1291
- var withdrawMetalResponseParser = /*#__PURE__*/z.object({
1292
- success: /*#__PURE__*/z.boolean(),
1293
- id: /*#__PURE__*/z.string()
1297
+ var withdrawMetalResponseParser = /*#__PURE__*/z.z.object({
1298
+ success: /*#__PURE__*/z.z["boolean"](),
1299
+ id: /*#__PURE__*/z.z.string()
1294
1300
  });
1295
- var withdrawalFeeQuoteParser = /*#__PURE__*/z.object({
1296
- quoteId: /*#__PURE__*/z.string(),
1297
- estimatedFee: /*#__PURE__*/z.string(),
1298
- currency: /*#__PURE__*/z.string(),
1299
- network: /*#__PURE__*/z.string()
1301
+ var withdrawalFeeQuoteParser = /*#__PURE__*/z.z.object({
1302
+ quoteId: /*#__PURE__*/z.z.string(),
1303
+ estimatedFee: /*#__PURE__*/z.z.string(),
1304
+ currency: /*#__PURE__*/z.z.string(),
1305
+ network: /*#__PURE__*/z.z.string()
1300
1306
  });
1301
1307
 
1302
- var withdrawHistoryMetalSwapParser = /*#__PURE__*/z.object({
1303
- id: /*#__PURE__*/z.string(),
1304
- status: /*#__PURE__*/z.string(),
1305
- amount: /*#__PURE__*/z.string(),
1306
- currency: /*#__PURE__*/z.string(),
1307
- network: /*#__PURE__*/z.string(),
1308
- created: /*#__PURE__*/z.string(),
1309
- withdrawalAddress: /*#__PURE__*/z.string(),
1310
- withdrawalHash: /*#__PURE__*/z.string().optional()
1308
+ var withdrawHistoryMetalSwapParser = /*#__PURE__*/z.z.object({
1309
+ id: /*#__PURE__*/z.z.string(),
1310
+ status: /*#__PURE__*/z.z.string(),
1311
+ amount: /*#__PURE__*/z.z.string(),
1312
+ currency: /*#__PURE__*/z.z.string(),
1313
+ network: /*#__PURE__*/z.z.string(),
1314
+ created: /*#__PURE__*/z.z.string(),
1315
+ withdrawalAddress: /*#__PURE__*/z.z.string(),
1316
+ withdrawalHash: /*#__PURE__*/z.z.string().optional()
1311
1317
  });
1312
- var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.object({
1313
- swaps: /*#__PURE__*/z.array(withdrawHistoryMetalSwapParser),
1314
- page: /*#__PURE__*/z.number(),
1315
- pageSize: /*#__PURE__*/z.number(),
1316
- numberOfElements: /*#__PURE__*/z.number(),
1317
- totalPages: /*#__PURE__*/z.number(),
1318
- totalElements: /*#__PURE__*/z.number()
1318
+ var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.z.object({
1319
+ swaps: /*#__PURE__*/z.z.array(withdrawHistoryMetalSwapParser),
1320
+ page: /*#__PURE__*/z.z.number(),
1321
+ pageSize: /*#__PURE__*/z.z.number(),
1322
+ numberOfElements: /*#__PURE__*/z.z.number(),
1323
+ totalPages: /*#__PURE__*/z.z.number(),
1324
+ totalElements: /*#__PURE__*/z.z.number()
1319
1325
  });
1320
1326
 
1321
1327
  (function (Status) {
@@ -1325,31 +1331,207 @@ var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.object({
1325
1331
  Status["PROCESSING"] = "processing";
1326
1332
  })(exports.Status || (exports.Status = {}));
1327
1333
 
1328
- var wrapStartParser = /*#__PURE__*/z.object({
1334
+ var wrapStartParser = /*#__PURE__*/z.z.object({
1329
1335
  balance: ExtendedAssetParser,
1330
- id: /*#__PURE__*/z.string(),
1331
- txid: /*#__PURE__*/z.string(),
1332
- chain: /*#__PURE__*/z.string(),
1333
- deposit_address: /*#__PURE__*/z.string(),
1334
- confirmations: /*#__PURE__*/z.number()
1336
+ id: /*#__PURE__*/z.z.string(),
1337
+ txid: /*#__PURE__*/z.z.string(),
1338
+ chain: /*#__PURE__*/z.z.string(),
1339
+ deposit_address: /*#__PURE__*/z.z.string(),
1340
+ confirmations: /*#__PURE__*/z.z.number()
1335
1341
  });
1336
- var wrapSetConfParser = /*#__PURE__*/z.object({
1337
- wrap_hash: /*#__PURE__*/z.string(),
1338
- confirmations: /*#__PURE__*/z.number()
1342
+ var wrapSetConfParser = /*#__PURE__*/z.z.object({
1343
+ wrap_hash: /*#__PURE__*/z.z.string(),
1344
+ confirmations: /*#__PURE__*/z.z.number()
1339
1345
  });
1340
- var wrapParser = /*#__PURE__*/z.object({
1341
- index: /*#__PURE__*/z.number(),
1342
- proton_account: /*#__PURE__*/z.string(),
1346
+ var wrapParser = /*#__PURE__*/z.z.object({
1347
+ index: /*#__PURE__*/z.z.number(),
1348
+ proton_account: /*#__PURE__*/z.z.string(),
1343
1349
  balance: ExtendedAssetParser,
1344
- id: /*#__PURE__*/z.string(),
1345
- txid: /*#__PURE__*/z.string(),
1346
- chain: /*#__PURE__*/z.string(),
1347
- deposit_address: /*#__PURE__*/z.string(),
1348
- status: /*#__PURE__*/z.nativeEnum(exports.Status),
1349
- finish_txid: /*#__PURE__*/z.string(),
1350
- wrap_hash: /*#__PURE__*/z.string(),
1351
- confirmations: /*#__PURE__*/z.number()
1350
+ id: /*#__PURE__*/z.z.string(),
1351
+ txid: /*#__PURE__*/z.z.string(),
1352
+ chain: /*#__PURE__*/z.z.string(),
1353
+ deposit_address: /*#__PURE__*/z.z.string(),
1354
+ status: /*#__PURE__*/z.z.nativeEnum(exports.Status),
1355
+ finish_txid: /*#__PURE__*/z.z.string(),
1356
+ wrap_hash: /*#__PURE__*/z.z.string(),
1357
+ confirmations: /*#__PURE__*/z.z.number()
1358
+ });
1359
+
1360
+ var numTransform = /*#__PURE__*/z.z.string().regex(/\d+/).transform(Number);
1361
+ var ohlcvParser = /*#__PURE__*/z.z.object({
1362
+ time: /*#__PURE__*/z.z.number(),
1363
+ open: /*#__PURE__*/z.z.number(),
1364
+ high: /*#__PURE__*/z.z.number(),
1365
+ low: /*#__PURE__*/z.z.number(),
1366
+ close: /*#__PURE__*/z.z.number(),
1367
+ volume: /*#__PURE__*/z.z.number(),
1368
+ volume_bid: /*#__PURE__*/z.z.number(),
1369
+ count: /*#__PURE__*/z.z.number()
1370
+ });
1371
+ var OHLCV_DTO = /*#__PURE__*/function (_createZodDto) {
1372
+ _inheritsLoose(OHLCV_DTO, _createZodDto);
1373
+
1374
+ function OHLCV_DTO() {
1375
+ return _createZodDto.apply(this, arguments) || this;
1376
+ }
1377
+
1378
+ return OHLCV_DTO;
1379
+ }( /*#__PURE__*/nestjsZod.createZodDto(ohlcvParser));
1380
+ var getOhlcvParser = /*#__PURE__*/z.z.object({
1381
+ interval: /*#__PURE__*/z.z.string(),
1382
+ dateFrom: /*#__PURE__*/z.z.string(),
1383
+ dateTo: /*#__PURE__*/z.z.string(),
1384
+ marketId: /*#__PURE__*/z.z.number().or(numTransform),
1385
+ limit: /*#__PURE__*/z.z.number().or(numTransform)["default"](500).refine(function (n) {
1386
+ return n <= 1000;
1387
+ }, 'Max limit is 1000')
1352
1388
  });
1389
+ var GetOHLCV_DTO = /*#__PURE__*/function (_createZodDto2) {
1390
+ _inheritsLoose(GetOHLCV_DTO, _createZodDto2);
1391
+
1392
+ function GetOHLCV_DTO() {
1393
+ return _createZodDto2.apply(this, arguments) || this;
1394
+ }
1395
+
1396
+ return GetOHLCV_DTO;
1397
+ }( /*#__PURE__*/nestjsZod.createZodDto(getOhlcvParser));
1398
+ var orderHistoryParser = /*#__PURE__*/z.z.object({
1399
+ seq: /*#__PURE__*/z.z.number(),
1400
+ block_num: /*#__PURE__*/z.z.number(),
1401
+ block_time: /*#__PURE__*/z.z.string(),
1402
+ order_id: /*#__PURE__*/z.z.number(),
1403
+ market_id: /*#__PURE__*/z.z.number(),
1404
+ quantity_init: /*#__PURE__*/z.z.number().optional(),
1405
+ quantity_curr: /*#__PURE__*/z.z.number(),
1406
+ price: /*#__PURE__*/z.z.number(),
1407
+ account_name: /*#__PURE__*/z.z.string(),
1408
+ order_side: /*#__PURE__*/z.z.number(),
1409
+ order_type: /*#__PURE__*/z.z.number(),
1410
+ status: /*#__PURE__*/z.z.string(),
1411
+ quantity_change: /*#__PURE__*/z.z.number(),
1412
+ trx_id: /*#__PURE__*/z.z.string()
1413
+ });
1414
+ var OrderHistory_DTO = /*#__PURE__*/function (_createZodDto3) {
1415
+ _inheritsLoose(OrderHistory_DTO, _createZodDto3);
1416
+
1417
+ function OrderHistory_DTO() {
1418
+ return _createZodDto3.apply(this, arguments) || this;
1419
+ }
1420
+
1421
+ return OrderHistory_DTO;
1422
+ }( /*#__PURE__*/nestjsZod.createZodDto(orderHistoryParser));
1423
+ var getOrderHistoryParser = /*#__PURE__*/z.z.object({
1424
+ account: /*#__PURE__*/z.z.string(),
1425
+ offset: /*#__PURE__*/z.z.number().or(numTransform)["default"](0),
1426
+ limit: /*#__PURE__*/z.z.number().or(numTransform)["default"](100).refine(function (n) {
1427
+ return n <= 250;
1428
+ }, 'Max limit is 250')
1429
+ });
1430
+ var GetOrderHistory_DTO = /*#__PURE__*/function (_createZodDto4) {
1431
+ _inheritsLoose(GetOrderHistory_DTO, _createZodDto4);
1432
+
1433
+ function GetOrderHistory_DTO() {
1434
+ return _createZodDto4.apply(this, arguments) || this;
1435
+ }
1436
+
1437
+ return GetOrderHistory_DTO;
1438
+ }( /*#__PURE__*/nestjsZod.createZodDto(getOrderHistoryParser));
1439
+ var depthParser = /*#__PURE__*/z.z.object({
1440
+ level: /*#__PURE__*/z.z.string(),
1441
+ ask: /*#__PURE__*/z.z.string(),
1442
+ bid: /*#__PURE__*/z.z.string(),
1443
+ count: /*#__PURE__*/z.z.number()
1444
+ });
1445
+ var Depth_DTO = /*#__PURE__*/function (_createZodDto5) {
1446
+ _inheritsLoose(Depth_DTO, _createZodDto5);
1447
+
1448
+ function Depth_DTO() {
1449
+ return _createZodDto5.apply(this, arguments) || this;
1450
+ }
1451
+
1452
+ return Depth_DTO;
1453
+ }( /*#__PURE__*/nestjsZod.createZodDto(depthParser));
1454
+ var getDepthParser = /*#__PURE__*/z.z.object({
1455
+ marketId: /*#__PURE__*/z.z.number(),
1456
+ step: /*#__PURE__*/z.z.string(),
1457
+ side: /*#__PURE__*/z.z.string(),
1458
+ limit: /*#__PURE__*/z.z.number().or(numTransform)["default"](100).refine(function (n) {
1459
+ return n <= 250;
1460
+ }, 'Max limit is 250')
1461
+ });
1462
+ var GetDepth_DTO = /*#__PURE__*/function (_createZodDto6) {
1463
+ _inheritsLoose(GetDepth_DTO, _createZodDto6);
1464
+
1465
+ function GetDepth_DTO() {
1466
+ return _createZodDto6.apply(this, arguments) || this;
1467
+ }
1468
+
1469
+ return GetDepth_DTO;
1470
+ }( /*#__PURE__*/nestjsZod.createZodDto(getDepthParser));
1471
+ var tradeParser = /*#__PURE__*/z.z.object({
1472
+ block_num: /*#__PURE__*/z.z.number(),
1473
+ block_time: /*#__PURE__*/z.z.string(),
1474
+ trade_id: /*#__PURE__*/z.z.number(),
1475
+ market_id: /*#__PURE__*/z.z.number(),
1476
+ price: /*#__PURE__*/z.z.number(),
1477
+ bid_user: /*#__PURE__*/z.z.string(),
1478
+ bid_user_order_id: /*#__PURE__*/z.z.number(),
1479
+ bid_amount: /*#__PURE__*/z.z.number(),
1480
+ bid_fee: /*#__PURE__*/z.z.number(),
1481
+ ask_user: /*#__PURE__*/z.z.string(),
1482
+ ask_user_order_id: /*#__PURE__*/z.z.number(),
1483
+ ask_amount: /*#__PURE__*/z.z.number(),
1484
+ ask_fee: /*#__PURE__*/z.z.number(),
1485
+ order_side: /*#__PURE__*/z.z.number(),
1486
+ trx_id: /*#__PURE__*/z.z.string()
1487
+ });
1488
+ var Trade_DTO = /*#__PURE__*/function (_createZodDto7) {
1489
+ _inheritsLoose(Trade_DTO, _createZodDto7);
1490
+
1491
+ function Trade_DTO() {
1492
+ return _createZodDto7.apply(this, arguments) || this;
1493
+ }
1494
+
1495
+ return Trade_DTO;
1496
+ }( /*#__PURE__*/nestjsZod.createZodDto(tradeParser));
1497
+ var getTradesParser = /*#__PURE__*/z.z.object({
1498
+ marketId: /*#__PURE__*/z.z.number().or(numTransform),
1499
+ offset: /*#__PURE__*/z.z.number().or(numTransform)["default"](0),
1500
+ limit: /*#__PURE__*/z.z.number().or(numTransform)["default"](100).refine(function (n) {
1501
+ return n <= 250;
1502
+ }, 'Max limit is 250')
1503
+ });
1504
+ var GetTrades_DTO = /*#__PURE__*/function (_createZodDto8) {
1505
+ _inheritsLoose(GetTrades_DTO, _createZodDto8);
1506
+
1507
+ function GetTrades_DTO() {
1508
+ return _createZodDto8.apply(this, arguments) || this;
1509
+ }
1510
+
1511
+ return GetTrades_DTO;
1512
+ }( /*#__PURE__*/nestjsZod.createZodDto(getTradesParser));
1513
+
1514
+ (function (orderType) {
1515
+ orderType[orderType["INVALID"] = 0] = "INVALID";
1516
+ orderType[orderType["MARKET"] = 1] = "MARKET";
1517
+ orderType[orderType["LIMIT"] = 2] = "LIMIT";
1518
+ orderType[orderType["STOPLOSS"] = 3] = "STOPLOSS";
1519
+ orderType[orderType["TAKEPROFIT"] = 4] = "TAKEPROFIT";
1520
+ })(exports.orderType || (exports.orderType = {}));
1521
+
1522
+ (function (orderSide) {
1523
+ orderSide[orderSide["INVALID"] = 0] = "INVALID";
1524
+ orderSide[orderSide["BUY"] = 1] = "BUY";
1525
+ orderSide[orderSide["SELL"] = 2] = "SELL";
1526
+ })(exports.orderSide || (exports.orderSide = {}));
1527
+
1528
+ (function (logStatus) {
1529
+ logStatus["CREATE"] = "create";
1530
+ logStatus["UPDATE"] = "update";
1531
+ logStatus["TRANSFER"] = "transfer";
1532
+ logStatus["CANCEL"] = "cancel";
1533
+ logStatus["DELETE"] = "delete";
1534
+ })(exports.logStatus || (exports.logStatus = {}));
1353
1535
 
1354
1536
  var isSameToken = function isSameToken(token1, token2) {
1355
1537
  return token1.xtokenSymbol === token2.xtokenSymbol && token1.xtokenPrecision === token2.xtokenPrecision && token1.xtokenContract === token2.xtokenContract;
@@ -1647,11 +1829,19 @@ var applyDiscountToFee = function applyDiscountToFee(fee, staked) {
1647
1829
  }
1648
1830
  };
1649
1831
 
1832
+ exports.Depth_DTO = Depth_DTO;
1650
1833
  exports.ExtendedAssetParser = ExtendedAssetParser;
1651
1834
  exports.FEE_FACTOR = FEE_FACTOR;
1835
+ exports.GetDepth_DTO = GetDepth_DTO;
1836
+ exports.GetOHLCV_DTO = GetOHLCV_DTO;
1837
+ exports.GetOrderHistory_DTO = GetOrderHistory_DTO;
1838
+ exports.GetTrades_DTO = GetTrades_DTO;
1652
1839
  exports.Graph = Graph;
1653
1840
  exports.ILink = ILink;
1654
1841
  exports.INode = INode;
1842
+ exports.OHLCV_DTO = OHLCV_DTO;
1843
+ exports.OrderHistory_DTO = OrderHistory_DTO;
1844
+ exports.Trade_DTO = Trade_DTO;
1655
1845
  exports.WRAP_AUTH_ACTION = WRAP_AUTH_ACTION;
1656
1846
  exports.WRAP_CONTRACT = WRAP_CONTRACT;
1657
1847
  exports.accountParser = accountParser;