@proton/wrap-constants 0.0.83 → 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
 
@@ -923,77 +924,77 @@ var initializeCoins = function initializeCoins(protonChain) {
923
924
  };
924
925
  };
925
926
 
926
- var accountParser = /*#__PURE__*/z.string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
927
- 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({
928
929
  actor: accountParser,
929
- permission: /*#__PURE__*/z.string()
930
+ permission: /*#__PURE__*/z.z.string()
930
931
  });
931
- var authorizationsParser = /*#__PURE__*/z.array(authorizationParser).min(1);
932
- var ExtendedAssetParser = /*#__PURE__*/z.object({
933
- 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(),
934
935
  contract: accountParser
935
936
  });
936
937
 
937
- var actionParser = /*#__PURE__*/z.object({
938
- account: /*#__PURE__*/z.string(),
939
- name: /*#__PURE__*/z.string(),
940
- authorization: /*#__PURE__*/z.array( /*#__PURE__*/z.object({
941
- actor: /*#__PURE__*/z.string(),
942
- 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()
943
944
  })),
944
- data: /*#__PURE__*/z.any(),
945
- hex_data: /*#__PURE__*/z.string().optional()
945
+ data: /*#__PURE__*/z.z.any(),
946
+ hex_data: /*#__PURE__*/z.z.string().optional()
946
947
  });
947
- var transactionExtensionsParser = /*#__PURE__*/z.array(z.number().or(z.string())).optional();
948
- var rawTransactionParser = /*#__PURE__*/z.object({
949
- expiration: /*#__PURE__*/z.string(),
950
- ref_block_num: /*#__PURE__*/z.number(),
951
- ref_block_prefix: /*#__PURE__*/z.number(),
952
- max_net_usage_words: /*#__PURE__*/z.number(),
953
- max_cpu_usage_ms: /*#__PURE__*/z.number(),
954
- delay_sec: /*#__PURE__*/z.number(),
955
- context_free_actions: /*#__PURE__*/z.array(actionParser),
956
- 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)
957
958
  });
958
959
  var baseActionParser = function baseActionParser(contract, action, data) {
959
- return z.object({
960
- account: contract === '*' ? accountParser : z.literal(contract),
961
- name: z.literal(action),
962
- 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),
963
964
  authorization: authorizationsParser
964
965
  });
965
966
  };
966
967
  var baseActionSerializedParser = function baseActionSerializedParser(contract, action, data) {
967
- return z.object({
968
- account: contract === '*' ? accountParser : z.literal(contract),
969
- name: z.literal(action),
970
- 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)),
971
972
  authorization: authorizationsParser
972
973
  });
973
974
  };
974
975
  var webauthActionParser = function webauthActionParser(contract, action, data) {
975
- return z.object({
976
- account: z.literal('webauthn'),
977
- name: z.literal('exec'),
978
- 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({
979
980
  account: accountParser,
980
- key: z.object({
981
- key: z.array(z.string().or(z.object({
982
- modulus: z.string(),
983
- 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()
984
985
  }))),
985
- user_presence: z.number(),
986
- rpid: z.string()
986
+ user_presence: z.z.number(),
987
+ rpid: z.z.string()
987
988
  }),
988
- nonce: z.number(),
989
+ nonce: z.z.number(),
989
990
  permissions: authorizationsParser,
990
- signature: z.object({
991
- auth_data: z.string(),
992
- client_json: z.string(),
993
- 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()
994
995
  }),
995
- trx: rawTransactionParser.merge(z.object({
996
- 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)
997
998
  }))
998
999
  }),
999
1000
  authorization: authorizationsParser
@@ -1002,8 +1003,8 @@ var webauthActionParser = function webauthActionParser(contract, action, data) {
1002
1003
  var singleActionTransactionParser = function singleActionTransactionParser(contract, action, data) {
1003
1004
  var baseAction = baseActionParser(contract, action, data);
1004
1005
  var webauthAction = webauthActionParser(contract, action, data);
1005
- return rawTransactionParser.merge(z.object({
1006
- 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)
1007
1008
  }));
1008
1009
  };
1009
1010
 
@@ -1025,6 +1026,22 @@ function _extends() {
1025
1026
  return _extends.apply(this, arguments);
1026
1027
  }
1027
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
+
1028
1045
  function _unsupportedIterableToArray(o, minLen) {
1029
1046
  if (!o) return;
1030
1047
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -1078,6 +1095,7 @@ var initializeConstants = function initializeConstants(chain) {
1078
1095
 
1079
1096
  var constants = {
1080
1097
  SWAP_CONTRACT: 'proton.swaps',
1098
+ DEX_CONTRACT: chain === 'proton' ? 'dextest21' : 'dex',
1081
1099
  FEE_FACTOR: FEE_FACTOR,
1082
1100
  GOOGLE_MAPS_KEY: 'AIzaSyDb2_CrK032kSIqBXbkdwmaLKWELl0SxVs',
1083
1101
  SWAP_URL: chain === 'proton' ? 'https://otc.protonswap.com' : 'https://otc-test.protonswap.com',
@@ -1112,7 +1130,8 @@ var initializeConstants = function initializeConstants(chain) {
1112
1130
  WRAP_AUTH_ACTION: WRAP_AUTH_ACTION,
1113
1131
  METAL_ENDPOINT: chain === 'proton' ? 'https://cirrus.metalpay.com' : 'https://cirrus-dev.metalpay.com',
1114
1132
  METAL_PROTON_ENDPOINT: chain === 'proton' ? 'https://api.protonchain.com' : 'https://api-dev.protonchain.com',
1115
- 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'],
1116
1135
  CHAIN_ID: chain === 'proton' ? '384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0' : '71ee83bcf52142d61019d95f9cc5427ba6a0d7ff8accd9e2088ae2abeaf3d3dd',
1117
1136
  CHAIN: chain,
1118
1137
  SWAP_COINS: swapCoins,
@@ -1160,57 +1179,57 @@ var initializeConstants = function initializeConstants(chain) {
1160
1179
  };
1161
1180
 
1162
1181
  var createAbstractAuthParser = function createAbstractAuthParser(contract, action, data) {
1163
- return z.object({
1182
+ return z.z.object({
1164
1183
  signer: authorizationParser,
1165
- signatures: z.array(z.string()).length(1),
1184
+ signatures: z.z.array(z.z.string()).length(1),
1166
1185
  transaction: singleActionTransactionParser(contract, action, data)
1167
1186
  });
1168
1187
  };
1169
1188
  var generateAuthData = {
1170
- time: /*#__PURE__*/z.string(),
1171
- protonAccount: /*#__PURE__*/z.string()
1189
+ time: /*#__PURE__*/z.z.string(),
1190
+ protonAccount: /*#__PURE__*/z.z.string()
1172
1191
  };
1173
1192
  var generateAuthParser = /*#__PURE__*/createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
1174
1193
 
1175
- var addressParser = /*#__PURE__*/z.object({
1176
- index: /*#__PURE__*/z.number(),
1194
+ var addressParser = /*#__PURE__*/z.z.object({
1195
+ index: /*#__PURE__*/z.z.number(),
1177
1196
  account: accountParser,
1178
- chain: /*#__PURE__*/z.string(),
1179
- address: /*#__PURE__*/z.string(),
1180
- address_hash: /*#__PURE__*/z.string()
1197
+ chain: /*#__PURE__*/z.z.string(),
1198
+ address: /*#__PURE__*/z.z.string(),
1199
+ address_hash: /*#__PURE__*/z.z.string()
1181
1200
  });
1182
- var generateAddressBodyParser = /*#__PURE__*/z.object({
1183
- coin: z.string(),
1184
- wallet: z.string()
1201
+ var generateAddressBodyParser = /*#__PURE__*/z.z.object({
1202
+ coin: z.z.string(),
1203
+ wallet: z.z.string()
1185
1204
  }).merge(generateAuthParser);
1186
- var generateAddressResponse = /*#__PURE__*/z.object({
1187
- id: /*#__PURE__*/z.string(),
1188
- address: /*#__PURE__*/z.string(),
1189
- coin: /*#__PURE__*/z.string(),
1190
- wallet: /*#__PURE__*/z.string(),
1191
- 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()
1192
1211
  });
1193
1212
 
1194
- var rateParser = /*#__PURE__*/z.object({
1195
- counterCurrency: /*#__PURE__*/z.string(),
1196
- price: /*#__PURE__*/z.number(),
1197
- priceChangePercent: /*#__PURE__*/z.number(),
1198
- marketCap: /*#__PURE__*/z.number(),
1199
- volume: /*#__PURE__*/z.number(),
1200
- 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()
1201
1220
  });
1202
- var exchangeRateParser = /*#__PURE__*/z.object({
1203
- contract: /*#__PURE__*/z.string(),
1204
- symbol: /*#__PURE__*/z.string(),
1205
- rank: /*#__PURE__*/z.number(),
1206
- 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)
1207
1226
  });
1208
- var exchangeRatesParser = /*#__PURE__*/z.array(exchangeRateParser);
1209
- var bloksRatesParser = /*#__PURE__*/z.array( /*#__PURE__*/z.object({
1210
- contract: /*#__PURE__*/z.string(),
1211
- symbol: /*#__PURE__*/z.string(),
1212
- rank: /*#__PURE__*/z.number(),
1213
- 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)
1214
1233
  }));
1215
1234
 
1216
1235
  (function (Type) {
@@ -1218,91 +1237,91 @@ var bloksRatesParser = /*#__PURE__*/z.array( /*#__PURE__*/z.object({
1218
1237
  Type["SEND"] = "send";
1219
1238
  })(exports.Type || (exports.Type = {}));
1220
1239
 
1221
- var depositBodyParser = /*#__PURE__*/z.object({
1222
- id: /*#__PURE__*/z.string(),
1223
- type: /*#__PURE__*/z.nativeEnum(exports.Type),
1224
- hash: /*#__PURE__*/z.string(),
1225
- coin: /*#__PURE__*/z.string(),
1226
- 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"
1227
1246
 
1228
1247
  });
1229
- var transactionParser = /*#__PURE__*/z.object({
1230
- id: /*#__PURE__*/z.string(),
1231
- wallet: /*#__PURE__*/z.string(),
1232
- value: /*#__PURE__*/z.number(),
1233
- valueString: /*#__PURE__*/z.string(),
1234
- address: /*#__PURE__*/z.string(),
1235
- type: /*#__PURE__*/z.nativeEnum(exports.Type),
1236
- state: /*#__PURE__*/z.string(),
1237
- confirmations: /*#__PURE__*/z.number(),
1238
- hash: /*#__PURE__*/z.string(),
1239
- blockHash: /*#__PURE__*/z.string().optional().nullable(),
1240
- 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
1241
1260
 
1242
1261
  });
1243
1262
 
1244
- var otcOrderResponseParser = /*#__PURE__*/z.object({
1245
- success: /*#__PURE__*/z.boolean(),
1246
- transaction_id: /*#__PURE__*/z.string(),
1247
- 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()
1248
1267
  });
1249
- var otcQuoteBodyParser = /*#__PURE__*/z.object({
1250
- baseAmount: /*#__PURE__*/z.number(),
1251
- baseSymbol: /*#__PURE__*/z.string(),
1252
- 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()
1253
1272
  });
1254
- var otcQuoteResponseParser = /*#__PURE__*/z.object({
1255
- success: /*#__PURE__*/z.boolean(),
1256
- token: /*#__PURE__*/z.string(),
1257
- qty: /*#__PURE__*/z.number(),
1258
- 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()
1259
1278
  });
1260
1279
 
1261
1280
  var withdrawData = {
1262
- from: /*#__PURE__*/z.string().refine(function (val) {
1281
+ from: /*#__PURE__*/z.z.string().refine(function (val) {
1263
1282
  return val !== WRAP_CONTRACT;
1264
1283
  }, {
1265
1284
  message: WRAP_CONTRACT + " must be receiver"
1266
1285
  }),
1267
- to: /*#__PURE__*/z.literal(WRAP_CONTRACT),
1268
- quantity: /*#__PURE__*/z.string(),
1269
- memo: /*#__PURE__*/z.string()
1286
+ to: /*#__PURE__*/z.z.literal(WRAP_CONTRACT),
1287
+ quantity: /*#__PURE__*/z.z.string(),
1288
+ memo: /*#__PURE__*/z.z.string()
1270
1289
  };
1271
- var withdrawBodyParser = /*#__PURE__*/z.object({
1290
+ var withdrawBodyParser = /*#__PURE__*/z.z.object({
1272
1291
  signer: authorizationParser,
1273
- signatures: /*#__PURE__*/z.array(z.string()).length(1),
1292
+ signatures: /*#__PURE__*/z.z.array(z.z.string()).length(1),
1274
1293
  transaction: /*#__PURE__*/singleActionTransactionParser('*', 'transfer', withdrawData),
1275
- quoteId: /*#__PURE__*/z.string(),
1276
- provider: /*#__PURE__*/z.string().optional()
1294
+ quoteId: /*#__PURE__*/z.z.string(),
1295
+ provider: /*#__PURE__*/z.z.string().optional()
1277
1296
  });
1278
- var withdrawMetalResponseParser = /*#__PURE__*/z.object({
1279
- success: /*#__PURE__*/z.boolean(),
1280
- id: /*#__PURE__*/z.string()
1297
+ var withdrawMetalResponseParser = /*#__PURE__*/z.z.object({
1298
+ success: /*#__PURE__*/z.z["boolean"](),
1299
+ id: /*#__PURE__*/z.z.string()
1281
1300
  });
1282
- var withdrawalFeeQuoteParser = /*#__PURE__*/z.object({
1283
- quoteId: /*#__PURE__*/z.string(),
1284
- estimatedFee: /*#__PURE__*/z.string(),
1285
- currency: /*#__PURE__*/z.string(),
1286
- 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()
1287
1306
  });
1288
1307
 
1289
- var withdrawHistoryMetalSwapParser = /*#__PURE__*/z.object({
1290
- id: /*#__PURE__*/z.string(),
1291
- status: /*#__PURE__*/z.string(),
1292
- amount: /*#__PURE__*/z.string(),
1293
- currency: /*#__PURE__*/z.string(),
1294
- network: /*#__PURE__*/z.string(),
1295
- created: /*#__PURE__*/z.string(),
1296
- withdrawalAddress: /*#__PURE__*/z.string(),
1297
- 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()
1298
1317
  });
1299
- var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.object({
1300
- swaps: /*#__PURE__*/z.array(withdrawHistoryMetalSwapParser),
1301
- page: /*#__PURE__*/z.number(),
1302
- pageSize: /*#__PURE__*/z.number(),
1303
- numberOfElements: /*#__PURE__*/z.number(),
1304
- totalPages: /*#__PURE__*/z.number(),
1305
- 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()
1306
1325
  });
1307
1326
 
1308
1327
  (function (Status) {
@@ -1312,31 +1331,207 @@ var withdrawHistoryMetalResponseParser = /*#__PURE__*/z.object({
1312
1331
  Status["PROCESSING"] = "processing";
1313
1332
  })(exports.Status || (exports.Status = {}));
1314
1333
 
1315
- var wrapStartParser = /*#__PURE__*/z.object({
1334
+ var wrapStartParser = /*#__PURE__*/z.z.object({
1316
1335
  balance: ExtendedAssetParser,
1317
- id: /*#__PURE__*/z.string(),
1318
- txid: /*#__PURE__*/z.string(),
1319
- chain: /*#__PURE__*/z.string(),
1320
- deposit_address: /*#__PURE__*/z.string(),
1321
- 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()
1322
1341
  });
1323
- var wrapSetConfParser = /*#__PURE__*/z.object({
1324
- wrap_hash: /*#__PURE__*/z.string(),
1325
- confirmations: /*#__PURE__*/z.number()
1342
+ var wrapSetConfParser = /*#__PURE__*/z.z.object({
1343
+ wrap_hash: /*#__PURE__*/z.z.string(),
1344
+ confirmations: /*#__PURE__*/z.z.number()
1326
1345
  });
1327
- var wrapParser = /*#__PURE__*/z.object({
1328
- index: /*#__PURE__*/z.number(),
1329
- 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(),
1330
1349
  balance: ExtendedAssetParser,
1331
- id: /*#__PURE__*/z.string(),
1332
- txid: /*#__PURE__*/z.string(),
1333
- chain: /*#__PURE__*/z.string(),
1334
- deposit_address: /*#__PURE__*/z.string(),
1335
- status: /*#__PURE__*/z.nativeEnum(exports.Status),
1336
- finish_txid: /*#__PURE__*/z.string(),
1337
- wrap_hash: /*#__PURE__*/z.string(),
1338
- 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')
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')
1339
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 = {}));
1340
1535
 
1341
1536
  var isSameToken = function isSameToken(token1, token2) {
1342
1537
  return token1.xtokenSymbol === token2.xtokenSymbol && token1.xtokenPrecision === token2.xtokenPrecision && token1.xtokenContract === token2.xtokenContract;
@@ -1634,11 +1829,19 @@ var applyDiscountToFee = function applyDiscountToFee(fee, staked) {
1634
1829
  }
1635
1830
  };
1636
1831
 
1832
+ exports.Depth_DTO = Depth_DTO;
1637
1833
  exports.ExtendedAssetParser = ExtendedAssetParser;
1638
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;
1639
1839
  exports.Graph = Graph;
1640
1840
  exports.ILink = ILink;
1641
1841
  exports.INode = INode;
1842
+ exports.OHLCV_DTO = OHLCV_DTO;
1843
+ exports.OrderHistory_DTO = OrderHistory_DTO;
1844
+ exports.Trade_DTO = Trade_DTO;
1642
1845
  exports.WRAP_AUTH_ACTION = WRAP_AUTH_ACTION;
1643
1846
  exports.WRAP_CONTRACT = WRAP_CONTRACT;
1644
1847
  exports.accountParser = accountParser;