@proton/wrap-constants 0.2.26 → 0.2.28
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 +1 -1
- package/dist/parsers/login.d.ts +1 -1
- 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 +264 -255
- 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 +264 -255
- package/dist/wrap-constants.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/coins.ts +22 -10
- 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 +1 -1
- package/src/parsers/login.ts +1 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { string, object, array, literal, number, any, nativeEnum, boolean } from 'zod';
|
|
2
2
|
import cloneDeep from 'lodash.clonedeep';
|
|
3
3
|
import { BigNumber } from 'bignumber.js';
|
|
4
4
|
|
|
@@ -253,6 +253,15 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
253
253
|
provider: Providers.METAL,
|
|
254
254
|
hasWithdrawMemo: false
|
|
255
255
|
}] : [], IS_MAINNET ? [{
|
|
256
|
+
wallet: 'METAL',
|
|
257
|
+
symbol: 'METAL',
|
|
258
|
+
chain: Chains.MetalCMainnet,
|
|
259
|
+
network: Networks.EVM,
|
|
260
|
+
precision: 18,
|
|
261
|
+
contract: '',
|
|
262
|
+
provider: Providers.METAL,
|
|
263
|
+
hasWithdrawMemo: false
|
|
264
|
+
}, {
|
|
256
265
|
wallet: 'METAL',
|
|
257
266
|
symbol: 'METAL',
|
|
258
267
|
chain: Chains.EthereumMainnet,
|
|
@@ -1030,77 +1039,77 @@ var initializeCoins = function initializeCoins(protonChain) {
|
|
|
1030
1039
|
};
|
|
1031
1040
|
};
|
|
1032
1041
|
|
|
1033
|
-
var accountParser = /*#__PURE__*/
|
|
1034
|
-
var authorizationParser = /*#__PURE__*/
|
|
1042
|
+
var accountParser = /*#__PURE__*/string().regex(/^[.1-5a-z]{0,12}[.1-5a-j]?$/);
|
|
1043
|
+
var authorizationParser = /*#__PURE__*/object({
|
|
1035
1044
|
actor: accountParser,
|
|
1036
|
-
permission: /*#__PURE__*/
|
|
1045
|
+
permission: /*#__PURE__*/string()
|
|
1037
1046
|
});
|
|
1038
|
-
var authorizationsParser = /*#__PURE__*/
|
|
1039
|
-
var ExtendedAssetParser = /*#__PURE__*/
|
|
1040
|
-
quantity: /*#__PURE__*/
|
|
1047
|
+
var authorizationsParser = /*#__PURE__*/array(authorizationParser).min(1);
|
|
1048
|
+
var ExtendedAssetParser = /*#__PURE__*/object({
|
|
1049
|
+
quantity: /*#__PURE__*/string(),
|
|
1041
1050
|
contract: accountParser
|
|
1042
1051
|
});
|
|
1043
1052
|
|
|
1044
|
-
var actionParser = /*#__PURE__*/
|
|
1045
|
-
account: /*#__PURE__*/
|
|
1046
|
-
name: /*#__PURE__*/
|
|
1047
|
-
authorization: /*#__PURE__*/
|
|
1048
|
-
actor: /*#__PURE__*/
|
|
1049
|
-
permission: /*#__PURE__*/
|
|
1053
|
+
var actionParser = /*#__PURE__*/object({
|
|
1054
|
+
account: /*#__PURE__*/string(),
|
|
1055
|
+
name: /*#__PURE__*/string(),
|
|
1056
|
+
authorization: /*#__PURE__*/array( /*#__PURE__*/object({
|
|
1057
|
+
actor: /*#__PURE__*/string(),
|
|
1058
|
+
permission: /*#__PURE__*/string()
|
|
1050
1059
|
})),
|
|
1051
|
-
data: /*#__PURE__*/
|
|
1052
|
-
hex_data: /*#__PURE__*/
|
|
1060
|
+
data: /*#__PURE__*/any(),
|
|
1061
|
+
hex_data: /*#__PURE__*/string().optional()
|
|
1053
1062
|
});
|
|
1054
|
-
var transactionExtensionsParser = /*#__PURE__*/
|
|
1055
|
-
var rawTransactionParser = /*#__PURE__*/
|
|
1056
|
-
expiration: /*#__PURE__*/
|
|
1057
|
-
ref_block_num: /*#__PURE__*/
|
|
1058
|
-
ref_block_prefix: /*#__PURE__*/
|
|
1059
|
-
max_net_usage_words: /*#__PURE__*/
|
|
1060
|
-
max_cpu_usage_ms: /*#__PURE__*/
|
|
1061
|
-
delay_sec: /*#__PURE__*/
|
|
1062
|
-
context_free_actions: /*#__PURE__*/
|
|
1063
|
-
transaction_extensions: /*#__PURE__*/
|
|
1063
|
+
var transactionExtensionsParser = /*#__PURE__*/array(number().or(string())).optional();
|
|
1064
|
+
var rawTransactionParser = /*#__PURE__*/object({
|
|
1065
|
+
expiration: /*#__PURE__*/string(),
|
|
1066
|
+
ref_block_num: /*#__PURE__*/number(),
|
|
1067
|
+
ref_block_prefix: /*#__PURE__*/number(),
|
|
1068
|
+
max_net_usage_words: /*#__PURE__*/number(),
|
|
1069
|
+
max_cpu_usage_ms: /*#__PURE__*/number(),
|
|
1070
|
+
delay_sec: /*#__PURE__*/number(),
|
|
1071
|
+
context_free_actions: /*#__PURE__*/array(actionParser),
|
|
1072
|
+
transaction_extensions: /*#__PURE__*/array(transactionExtensionsParser)
|
|
1064
1073
|
});
|
|
1065
1074
|
var baseActionParser = function baseActionParser(contract, action, data) {
|
|
1066
|
-
return
|
|
1067
|
-
account: contract === '*' ? accountParser :
|
|
1068
|
-
name:
|
|
1069
|
-
data:
|
|
1075
|
+
return object({
|
|
1076
|
+
account: contract === '*' ? accountParser : literal(contract),
|
|
1077
|
+
name: literal(action),
|
|
1078
|
+
data: object(data),
|
|
1070
1079
|
authorization: authorizationsParser
|
|
1071
1080
|
});
|
|
1072
1081
|
};
|
|
1073
1082
|
var baseActionSerializedParser = function baseActionSerializedParser(contract, action, data) {
|
|
1074
|
-
return
|
|
1075
|
-
account: contract === '*' ? accountParser :
|
|
1076
|
-
name:
|
|
1077
|
-
data:
|
|
1083
|
+
return object({
|
|
1084
|
+
account: contract === '*' ? accountParser : literal(contract),
|
|
1085
|
+
name: literal(action),
|
|
1086
|
+
data: string().or(object(data)),
|
|
1078
1087
|
authorization: authorizationsParser
|
|
1079
1088
|
});
|
|
1080
1089
|
};
|
|
1081
1090
|
var webauthActionParser = function webauthActionParser(contract, action, data) {
|
|
1082
|
-
return
|
|
1083
|
-
account:
|
|
1084
|
-
name:
|
|
1085
|
-
data:
|
|
1091
|
+
return object({
|
|
1092
|
+
account: literal('webauthn'),
|
|
1093
|
+
name: literal('exec'),
|
|
1094
|
+
data: object({
|
|
1086
1095
|
account: accountParser,
|
|
1087
|
-
key:
|
|
1088
|
-
key:
|
|
1089
|
-
modulus:
|
|
1090
|
-
exponent:
|
|
1096
|
+
key: object({
|
|
1097
|
+
key: array(string().or(object({
|
|
1098
|
+
modulus: string(),
|
|
1099
|
+
exponent: string()
|
|
1091
1100
|
}))),
|
|
1092
|
-
user_presence:
|
|
1093
|
-
rpid:
|
|
1101
|
+
user_presence: number(),
|
|
1102
|
+
rpid: string()
|
|
1094
1103
|
}),
|
|
1095
|
-
nonce:
|
|
1104
|
+
nonce: number(),
|
|
1096
1105
|
permissions: authorizationsParser,
|
|
1097
|
-
signature:
|
|
1098
|
-
auth_data:
|
|
1099
|
-
client_json:
|
|
1100
|
-
signature:
|
|
1106
|
+
signature: object({
|
|
1107
|
+
auth_data: string(),
|
|
1108
|
+
client_json: string(),
|
|
1109
|
+
signature: string()
|
|
1101
1110
|
}),
|
|
1102
|
-
trx: rawTransactionParser.merge(
|
|
1103
|
-
actions:
|
|
1111
|
+
trx: rawTransactionParser.merge(object({
|
|
1112
|
+
actions: array(baseActionSerializedParser(contract, action, data)).length(1)
|
|
1104
1113
|
}))
|
|
1105
1114
|
}),
|
|
1106
1115
|
authorization: authorizationsParser
|
|
@@ -1109,8 +1118,8 @@ var webauthActionParser = function webauthActionParser(contract, action, data) {
|
|
|
1109
1118
|
var singleActionTransactionParser = function singleActionTransactionParser(contract, action, data) {
|
|
1110
1119
|
var baseAction = baseActionParser(contract, action, data);
|
|
1111
1120
|
var webauthAction = webauthActionParser(contract, action, data);
|
|
1112
|
-
return rawTransactionParser.merge(
|
|
1113
|
-
actions:
|
|
1121
|
+
return rawTransactionParser.merge(object({
|
|
1122
|
+
actions: array(baseAction.or(webauthAction)).length(1)
|
|
1114
1123
|
}));
|
|
1115
1124
|
};
|
|
1116
1125
|
|
|
@@ -1273,57 +1282,57 @@ var initializeConstants = function initializeConstants(chain) {
|
|
|
1273
1282
|
};
|
|
1274
1283
|
|
|
1275
1284
|
var createAbstractAuthParser = function createAbstractAuthParser(contract, action, data) {
|
|
1276
|
-
return
|
|
1285
|
+
return object({
|
|
1277
1286
|
signer: authorizationParser,
|
|
1278
|
-
signatures:
|
|
1287
|
+
signatures: array(string()).length(1),
|
|
1279
1288
|
transaction: singleActionTransactionParser(contract, action, data)
|
|
1280
1289
|
});
|
|
1281
1290
|
};
|
|
1282
1291
|
var generateAuthData = {
|
|
1283
|
-
time: /*#__PURE__*/
|
|
1284
|
-
protonAccount: /*#__PURE__*/
|
|
1292
|
+
time: /*#__PURE__*/string(),
|
|
1293
|
+
protonAccount: /*#__PURE__*/string()
|
|
1285
1294
|
};
|
|
1286
1295
|
var generateAuthParser = /*#__PURE__*/createAbstractAuthParser(WRAP_CONTRACT, WRAP_AUTH_ACTION, generateAuthData);
|
|
1287
1296
|
|
|
1288
|
-
var addressParser = /*#__PURE__*/
|
|
1289
|
-
index: /*#__PURE__*/
|
|
1297
|
+
var addressParser = /*#__PURE__*/object({
|
|
1298
|
+
index: /*#__PURE__*/number(),
|
|
1290
1299
|
account: accountParser,
|
|
1291
|
-
chain: /*#__PURE__*/
|
|
1292
|
-
address: /*#__PURE__*/
|
|
1293
|
-
address_hash: /*#__PURE__*/
|
|
1300
|
+
chain: /*#__PURE__*/string(),
|
|
1301
|
+
address: /*#__PURE__*/string(),
|
|
1302
|
+
address_hash: /*#__PURE__*/string()
|
|
1294
1303
|
});
|
|
1295
|
-
var generateAddressBodyParser = /*#__PURE__*/
|
|
1296
|
-
coin:
|
|
1297
|
-
wallet:
|
|
1304
|
+
var generateAddressBodyParser = /*#__PURE__*/object({
|
|
1305
|
+
coin: string(),
|
|
1306
|
+
wallet: string()
|
|
1298
1307
|
}).merge(generateAuthParser);
|
|
1299
|
-
var generateAddressResponse = /*#__PURE__*/
|
|
1300
|
-
id: /*#__PURE__*/
|
|
1301
|
-
address: /*#__PURE__*/
|
|
1302
|
-
coin: /*#__PURE__*/
|
|
1303
|
-
wallet: /*#__PURE__*/
|
|
1304
|
-
memo: /*#__PURE__*/
|
|
1308
|
+
var generateAddressResponse = /*#__PURE__*/object({
|
|
1309
|
+
id: /*#__PURE__*/string(),
|
|
1310
|
+
address: /*#__PURE__*/string(),
|
|
1311
|
+
coin: /*#__PURE__*/string(),
|
|
1312
|
+
wallet: /*#__PURE__*/string(),
|
|
1313
|
+
memo: /*#__PURE__*/string().optional()
|
|
1305
1314
|
});
|
|
1306
1315
|
|
|
1307
|
-
var rateParser = /*#__PURE__*/
|
|
1308
|
-
counterCurrency: /*#__PURE__*/
|
|
1309
|
-
price: /*#__PURE__*/
|
|
1310
|
-
priceChangePercent: /*#__PURE__*/
|
|
1311
|
-
marketCap: /*#__PURE__*/
|
|
1312
|
-
volume: /*#__PURE__*/
|
|
1313
|
-
timestamp: /*#__PURE__*/
|
|
1316
|
+
var rateParser = /*#__PURE__*/object({
|
|
1317
|
+
counterCurrency: /*#__PURE__*/string(),
|
|
1318
|
+
price: /*#__PURE__*/number(),
|
|
1319
|
+
priceChangePercent: /*#__PURE__*/number(),
|
|
1320
|
+
marketCap: /*#__PURE__*/number(),
|
|
1321
|
+
volume: /*#__PURE__*/number(),
|
|
1322
|
+
timestamp: /*#__PURE__*/number()
|
|
1314
1323
|
});
|
|
1315
|
-
var exchangeRateParser = /*#__PURE__*/
|
|
1316
|
-
contract: /*#__PURE__*/
|
|
1317
|
-
symbol: /*#__PURE__*/
|
|
1318
|
-
rank: /*#__PURE__*/
|
|
1319
|
-
rates: /*#__PURE__*/
|
|
1324
|
+
var exchangeRateParser = /*#__PURE__*/object({
|
|
1325
|
+
contract: /*#__PURE__*/string(),
|
|
1326
|
+
symbol: /*#__PURE__*/string(),
|
|
1327
|
+
rank: /*#__PURE__*/number(),
|
|
1328
|
+
rates: /*#__PURE__*/array(rateParser)
|
|
1320
1329
|
});
|
|
1321
|
-
var exchangeRatesParser = /*#__PURE__*/
|
|
1322
|
-
var bloksRatesParser = /*#__PURE__*/
|
|
1323
|
-
contract: /*#__PURE__*/
|
|
1324
|
-
symbol: /*#__PURE__*/
|
|
1325
|
-
rank: /*#__PURE__*/
|
|
1326
|
-
rates: /*#__PURE__*/
|
|
1330
|
+
var exchangeRatesParser = /*#__PURE__*/array(exchangeRateParser);
|
|
1331
|
+
var bloksRatesParser = /*#__PURE__*/array( /*#__PURE__*/object({
|
|
1332
|
+
contract: /*#__PURE__*/string(),
|
|
1333
|
+
symbol: /*#__PURE__*/string(),
|
|
1334
|
+
rank: /*#__PURE__*/number(),
|
|
1335
|
+
rates: /*#__PURE__*/array(rateParser)
|
|
1327
1336
|
}));
|
|
1328
1337
|
|
|
1329
1338
|
var Type;
|
|
@@ -1333,91 +1342,91 @@ var Type;
|
|
|
1333
1342
|
Type["SEND"] = "send";
|
|
1334
1343
|
})(Type || (Type = {}));
|
|
1335
1344
|
|
|
1336
|
-
var depositBodyParser = /*#__PURE__*/
|
|
1337
|
-
id: /*#__PURE__*/
|
|
1338
|
-
type: /*#__PURE__*/
|
|
1339
|
-
hash: /*#__PURE__*/
|
|
1340
|
-
coin: /*#__PURE__*/
|
|
1341
|
-
wallet: /*#__PURE__*/
|
|
1345
|
+
var depositBodyParser = /*#__PURE__*/object({
|
|
1346
|
+
id: /*#__PURE__*/string(),
|
|
1347
|
+
type: /*#__PURE__*/nativeEnum(Type),
|
|
1348
|
+
hash: /*#__PURE__*/string(),
|
|
1349
|
+
coin: /*#__PURE__*/string(),
|
|
1350
|
+
wallet: /*#__PURE__*/string() // "ETH-ROPSTEN" or "XPR-MAINNET"
|
|
1342
1351
|
|
|
1343
1352
|
});
|
|
1344
|
-
var transactionParser = /*#__PURE__*/
|
|
1345
|
-
id: /*#__PURE__*/
|
|
1346
|
-
wallet: /*#__PURE__*/
|
|
1347
|
-
value: /*#__PURE__*/
|
|
1348
|
-
valueString: /*#__PURE__*/
|
|
1349
|
-
address: /*#__PURE__*/
|
|
1350
|
-
type: /*#__PURE__*/
|
|
1351
|
-
state: /*#__PURE__*/
|
|
1352
|
-
confirmations: /*#__PURE__*/
|
|
1353
|
-
hash: /*#__PURE__*/
|
|
1354
|
-
blockHash: /*#__PURE__*/
|
|
1355
|
-
blockHeight: /*#__PURE__*/
|
|
1353
|
+
var transactionParser = /*#__PURE__*/object({
|
|
1354
|
+
id: /*#__PURE__*/string(),
|
|
1355
|
+
wallet: /*#__PURE__*/string(),
|
|
1356
|
+
value: /*#__PURE__*/number(),
|
|
1357
|
+
valueString: /*#__PURE__*/string(),
|
|
1358
|
+
address: /*#__PURE__*/string(),
|
|
1359
|
+
type: /*#__PURE__*/nativeEnum(Type),
|
|
1360
|
+
state: /*#__PURE__*/string(),
|
|
1361
|
+
confirmations: /*#__PURE__*/number(),
|
|
1362
|
+
hash: /*#__PURE__*/string(),
|
|
1363
|
+
blockHash: /*#__PURE__*/string().optional().nullable(),
|
|
1364
|
+
blockHeight: /*#__PURE__*/number().optional().nullable() // 643159
|
|
1356
1365
|
|
|
1357
1366
|
});
|
|
1358
1367
|
|
|
1359
|
-
var otcOrderResponseParser = /*#__PURE__*/
|
|
1360
|
-
success: /*#__PURE__*/
|
|
1361
|
-
transaction_id: /*#__PURE__*/
|
|
1362
|
-
errormsg: /*#__PURE__*/
|
|
1368
|
+
var otcOrderResponseParser = /*#__PURE__*/object({
|
|
1369
|
+
success: /*#__PURE__*/boolean(),
|
|
1370
|
+
transaction_id: /*#__PURE__*/string(),
|
|
1371
|
+
errormsg: /*#__PURE__*/string().optional()
|
|
1363
1372
|
});
|
|
1364
|
-
var otcQuoteBodyParser = /*#__PURE__*/
|
|
1365
|
-
baseAmount: /*#__PURE__*/
|
|
1366
|
-
baseSymbol: /*#__PURE__*/
|
|
1367
|
-
quoteSymbol: /*#__PURE__*/
|
|
1373
|
+
var otcQuoteBodyParser = /*#__PURE__*/object({
|
|
1374
|
+
baseAmount: /*#__PURE__*/number(),
|
|
1375
|
+
baseSymbol: /*#__PURE__*/string(),
|
|
1376
|
+
quoteSymbol: /*#__PURE__*/string()
|
|
1368
1377
|
});
|
|
1369
|
-
var otcQuoteResponseParser = /*#__PURE__*/
|
|
1370
|
-
success: /*#__PURE__*/
|
|
1371
|
-
token: /*#__PURE__*/
|
|
1372
|
-
qty: /*#__PURE__*/
|
|
1373
|
-
errormsg: /*#__PURE__*/
|
|
1378
|
+
var otcQuoteResponseParser = /*#__PURE__*/object({
|
|
1379
|
+
success: /*#__PURE__*/boolean(),
|
|
1380
|
+
token: /*#__PURE__*/string(),
|
|
1381
|
+
qty: /*#__PURE__*/number(),
|
|
1382
|
+
errormsg: /*#__PURE__*/string().optional()
|
|
1374
1383
|
});
|
|
1375
1384
|
|
|
1376
1385
|
var withdrawData = {
|
|
1377
|
-
from: /*#__PURE__*/
|
|
1386
|
+
from: /*#__PURE__*/string().refine(function (val) {
|
|
1378
1387
|
return val !== WRAP_CONTRACT;
|
|
1379
1388
|
}, {
|
|
1380
1389
|
message: WRAP_CONTRACT + " must be receiver"
|
|
1381
1390
|
}),
|
|
1382
|
-
to: /*#__PURE__*/
|
|
1383
|
-
quantity: /*#__PURE__*/
|
|
1384
|
-
memo: /*#__PURE__*/
|
|
1391
|
+
to: /*#__PURE__*/literal(WRAP_CONTRACT),
|
|
1392
|
+
quantity: /*#__PURE__*/string(),
|
|
1393
|
+
memo: /*#__PURE__*/string()
|
|
1385
1394
|
};
|
|
1386
|
-
var withdrawBodyParser = /*#__PURE__*/
|
|
1395
|
+
var withdrawBodyParser = /*#__PURE__*/object({
|
|
1387
1396
|
signer: authorizationParser,
|
|
1388
|
-
signatures: /*#__PURE__*/
|
|
1397
|
+
signatures: /*#__PURE__*/array(string()).length(1),
|
|
1389
1398
|
transaction: /*#__PURE__*/singleActionTransactionParser('*', 'transfer', withdrawData),
|
|
1390
|
-
quoteId: /*#__PURE__*/
|
|
1391
|
-
provider: /*#__PURE__*/
|
|
1399
|
+
quoteId: /*#__PURE__*/string(),
|
|
1400
|
+
provider: /*#__PURE__*/string().optional()
|
|
1392
1401
|
});
|
|
1393
|
-
var withdrawMetalResponseParser = /*#__PURE__*/
|
|
1394
|
-
success: /*#__PURE__*/
|
|
1395
|
-
id: /*#__PURE__*/
|
|
1402
|
+
var withdrawMetalResponseParser = /*#__PURE__*/object({
|
|
1403
|
+
success: /*#__PURE__*/boolean(),
|
|
1404
|
+
id: /*#__PURE__*/string()
|
|
1396
1405
|
});
|
|
1397
|
-
var withdrawalFeeQuoteParser = /*#__PURE__*/
|
|
1398
|
-
quoteId: /*#__PURE__*/
|
|
1399
|
-
estimatedFee: /*#__PURE__*/
|
|
1400
|
-
currency: /*#__PURE__*/
|
|
1401
|
-
network: /*#__PURE__*/
|
|
1406
|
+
var withdrawalFeeQuoteParser = /*#__PURE__*/object({
|
|
1407
|
+
quoteId: /*#__PURE__*/string(),
|
|
1408
|
+
estimatedFee: /*#__PURE__*/string(),
|
|
1409
|
+
currency: /*#__PURE__*/string(),
|
|
1410
|
+
network: /*#__PURE__*/string()
|
|
1402
1411
|
});
|
|
1403
1412
|
|
|
1404
|
-
var withdrawHistoryMetalSwapParser = /*#__PURE__*/
|
|
1405
|
-
id: /*#__PURE__*/
|
|
1406
|
-
status: /*#__PURE__*/
|
|
1407
|
-
amount: /*#__PURE__*/
|
|
1408
|
-
currency: /*#__PURE__*/
|
|
1409
|
-
network: /*#__PURE__*/
|
|
1410
|
-
created: /*#__PURE__*/
|
|
1411
|
-
withdrawalAddress: /*#__PURE__*/
|
|
1412
|
-
withdrawalHash: /*#__PURE__*/
|
|
1413
|
+
var withdrawHistoryMetalSwapParser = /*#__PURE__*/object({
|
|
1414
|
+
id: /*#__PURE__*/string(),
|
|
1415
|
+
status: /*#__PURE__*/string(),
|
|
1416
|
+
amount: /*#__PURE__*/string(),
|
|
1417
|
+
currency: /*#__PURE__*/string(),
|
|
1418
|
+
network: /*#__PURE__*/string(),
|
|
1419
|
+
created: /*#__PURE__*/string(),
|
|
1420
|
+
withdrawalAddress: /*#__PURE__*/string(),
|
|
1421
|
+
withdrawalHash: /*#__PURE__*/string().optional()
|
|
1413
1422
|
});
|
|
1414
|
-
var withdrawHistoryMetalResponseParser = /*#__PURE__*/
|
|
1415
|
-
swaps: /*#__PURE__*/
|
|
1416
|
-
page: /*#__PURE__*/
|
|
1417
|
-
pageSize: /*#__PURE__*/
|
|
1418
|
-
numberOfElements: /*#__PURE__*/
|
|
1419
|
-
totalPages: /*#__PURE__*/
|
|
1420
|
-
totalElements: /*#__PURE__*/
|
|
1423
|
+
var withdrawHistoryMetalResponseParser = /*#__PURE__*/object({
|
|
1424
|
+
swaps: /*#__PURE__*/array(withdrawHistoryMetalSwapParser),
|
|
1425
|
+
page: /*#__PURE__*/number(),
|
|
1426
|
+
pageSize: /*#__PURE__*/number(),
|
|
1427
|
+
numberOfElements: /*#__PURE__*/number(),
|
|
1428
|
+
totalPages: /*#__PURE__*/number(),
|
|
1429
|
+
totalElements: /*#__PURE__*/number()
|
|
1421
1430
|
});
|
|
1422
1431
|
|
|
1423
1432
|
var Status;
|
|
@@ -1429,131 +1438,131 @@ var Status;
|
|
|
1429
1438
|
Status["PROCESSING"] = "processing";
|
|
1430
1439
|
})(Status || (Status = {}));
|
|
1431
1440
|
|
|
1432
|
-
var wrapStartParser = /*#__PURE__*/
|
|
1441
|
+
var wrapStartParser = /*#__PURE__*/object({
|
|
1433
1442
|
balance: ExtendedAssetParser,
|
|
1434
|
-
id: /*#__PURE__*/
|
|
1435
|
-
txid: /*#__PURE__*/
|
|
1436
|
-
chain: /*#__PURE__*/
|
|
1437
|
-
deposit_address: /*#__PURE__*/
|
|
1438
|
-
confirmations: /*#__PURE__*/
|
|
1443
|
+
id: /*#__PURE__*/string(),
|
|
1444
|
+
txid: /*#__PURE__*/string(),
|
|
1445
|
+
chain: /*#__PURE__*/string(),
|
|
1446
|
+
deposit_address: /*#__PURE__*/string(),
|
|
1447
|
+
confirmations: /*#__PURE__*/number()
|
|
1439
1448
|
});
|
|
1440
|
-
var wrapSetConfParser = /*#__PURE__*/
|
|
1441
|
-
wrap_hash: /*#__PURE__*/
|
|
1442
|
-
confirmations: /*#__PURE__*/
|
|
1449
|
+
var wrapSetConfParser = /*#__PURE__*/object({
|
|
1450
|
+
wrap_hash: /*#__PURE__*/string(),
|
|
1451
|
+
confirmations: /*#__PURE__*/number()
|
|
1443
1452
|
});
|
|
1444
|
-
var wrapParser = /*#__PURE__*/
|
|
1445
|
-
index: /*#__PURE__*/
|
|
1446
|
-
proton_account: /*#__PURE__*/
|
|
1453
|
+
var wrapParser = /*#__PURE__*/object({
|
|
1454
|
+
index: /*#__PURE__*/number(),
|
|
1455
|
+
proton_account: /*#__PURE__*/string(),
|
|
1447
1456
|
balance: ExtendedAssetParser,
|
|
1448
|
-
id: /*#__PURE__*/
|
|
1449
|
-
txid: /*#__PURE__*/
|
|
1450
|
-
chain: /*#__PURE__*/
|
|
1451
|
-
deposit_address: /*#__PURE__*/
|
|
1452
|
-
status: /*#__PURE__*/
|
|
1453
|
-
finish_txid: /*#__PURE__*/
|
|
1454
|
-
wrap_hash: /*#__PURE__*/
|
|
1455
|
-
confirmations: /*#__PURE__*/
|
|
1457
|
+
id: /*#__PURE__*/string(),
|
|
1458
|
+
txid: /*#__PURE__*/string(),
|
|
1459
|
+
chain: /*#__PURE__*/string(),
|
|
1460
|
+
deposit_address: /*#__PURE__*/string(),
|
|
1461
|
+
status: /*#__PURE__*/nativeEnum(Status),
|
|
1462
|
+
finish_txid: /*#__PURE__*/string(),
|
|
1463
|
+
wrap_hash: /*#__PURE__*/string(),
|
|
1464
|
+
confirmations: /*#__PURE__*/number()
|
|
1456
1465
|
});
|
|
1457
1466
|
|
|
1458
1467
|
var _TOPICS;
|
|
1459
|
-
var numTransform = /*#__PURE__*/
|
|
1460
|
-
var ohlcvParser = /*#__PURE__*/
|
|
1461
|
-
time: /*#__PURE__*/
|
|
1462
|
-
open: /*#__PURE__*/
|
|
1463
|
-
high: /*#__PURE__*/
|
|
1464
|
-
low: /*#__PURE__*/
|
|
1465
|
-
close: /*#__PURE__*/
|
|
1466
|
-
volume: /*#__PURE__*/
|
|
1467
|
-
volume_bid: /*#__PURE__*/
|
|
1468
|
-
count: /*#__PURE__*/
|
|
1468
|
+
var numTransform = /*#__PURE__*/string().regex(/\d+/).transform(Number);
|
|
1469
|
+
var ohlcvParser = /*#__PURE__*/object({
|
|
1470
|
+
time: /*#__PURE__*/number(),
|
|
1471
|
+
open: /*#__PURE__*/number(),
|
|
1472
|
+
high: /*#__PURE__*/number(),
|
|
1473
|
+
low: /*#__PURE__*/number(),
|
|
1474
|
+
close: /*#__PURE__*/number(),
|
|
1475
|
+
volume: /*#__PURE__*/number(),
|
|
1476
|
+
volume_bid: /*#__PURE__*/number(),
|
|
1477
|
+
count: /*#__PURE__*/number()
|
|
1469
1478
|
});
|
|
1470
|
-
var getOhlcvParser = /*#__PURE__*/
|
|
1471
|
-
interval: /*#__PURE__*/
|
|
1472
|
-
dateFrom: /*#__PURE__*/
|
|
1473
|
-
dateTo: /*#__PURE__*/
|
|
1474
|
-
marketId: /*#__PURE__*/
|
|
1475
|
-
limit: /*#__PURE__*/
|
|
1479
|
+
var getOhlcvParser = /*#__PURE__*/object({
|
|
1480
|
+
interval: /*#__PURE__*/string(),
|
|
1481
|
+
dateFrom: /*#__PURE__*/string(),
|
|
1482
|
+
dateTo: /*#__PURE__*/string(),
|
|
1483
|
+
marketId: /*#__PURE__*/number().or(numTransform),
|
|
1484
|
+
limit: /*#__PURE__*/number().or(numTransform)["default"](500).refine(function (n) {
|
|
1476
1485
|
return n <= 1000;
|
|
1477
1486
|
}, 'Max limit is 1000')
|
|
1478
1487
|
});
|
|
1479
|
-
var orderHistoryParser = /*#__PURE__*/
|
|
1480
|
-
seq: /*#__PURE__*/
|
|
1481
|
-
block_num: /*#__PURE__*/
|
|
1482
|
-
block_time: /*#__PURE__*/
|
|
1483
|
-
order_id: /*#__PURE__*/
|
|
1484
|
-
market_id: /*#__PURE__*/
|
|
1485
|
-
quantity_init: /*#__PURE__*/
|
|
1486
|
-
quantity_curr: /*#__PURE__*/
|
|
1487
|
-
price: /*#__PURE__*/
|
|
1488
|
-
account_name: /*#__PURE__*/
|
|
1489
|
-
order_side: /*#__PURE__*/
|
|
1490
|
-
order_type: /*#__PURE__*/
|
|
1491
|
-
trigger_price: /*#__PURE__*/
|
|
1492
|
-
fill_type: /*#__PURE__*/
|
|
1493
|
-
status: /*#__PURE__*/
|
|
1494
|
-
quantity_change: /*#__PURE__*/
|
|
1495
|
-
trx_id: /*#__PURE__*/
|
|
1488
|
+
var orderHistoryParser = /*#__PURE__*/object({
|
|
1489
|
+
seq: /*#__PURE__*/number(),
|
|
1490
|
+
block_num: /*#__PURE__*/number(),
|
|
1491
|
+
block_time: /*#__PURE__*/string(),
|
|
1492
|
+
order_id: /*#__PURE__*/number(),
|
|
1493
|
+
market_id: /*#__PURE__*/number(),
|
|
1494
|
+
quantity_init: /*#__PURE__*/number().optional(),
|
|
1495
|
+
quantity_curr: /*#__PURE__*/number(),
|
|
1496
|
+
price: /*#__PURE__*/number(),
|
|
1497
|
+
account_name: /*#__PURE__*/string(),
|
|
1498
|
+
order_side: /*#__PURE__*/number(),
|
|
1499
|
+
order_type: /*#__PURE__*/number(),
|
|
1500
|
+
trigger_price: /*#__PURE__*/number(),
|
|
1501
|
+
fill_type: /*#__PURE__*/number(),
|
|
1502
|
+
status: /*#__PURE__*/string(),
|
|
1503
|
+
quantity_change: /*#__PURE__*/number(),
|
|
1504
|
+
trx_id: /*#__PURE__*/string()
|
|
1496
1505
|
});
|
|
1497
|
-
var getOrderHistoryParser = /*#__PURE__*/
|
|
1498
|
-
account: /*#__PURE__*/
|
|
1499
|
-
marketId: /*#__PURE__*/
|
|
1500
|
-
offset: /*#__PURE__*/
|
|
1501
|
-
limit: /*#__PURE__*/
|
|
1506
|
+
var getOrderHistoryParser = /*#__PURE__*/object({
|
|
1507
|
+
account: /*#__PURE__*/string(),
|
|
1508
|
+
marketId: /*#__PURE__*/number().or(numTransform).optional(),
|
|
1509
|
+
offset: /*#__PURE__*/number().or(numTransform)["default"](0),
|
|
1510
|
+
limit: /*#__PURE__*/number().or(numTransform)["default"](100).refine(function (n) {
|
|
1502
1511
|
return n <= 250;
|
|
1503
1512
|
}, 'Max limit is 250')
|
|
1504
1513
|
});
|
|
1505
|
-
var depthParser = /*#__PURE__*/
|
|
1506
|
-
level: /*#__PURE__*/
|
|
1507
|
-
ask: /*#__PURE__*/
|
|
1508
|
-
bid: /*#__PURE__*/
|
|
1509
|
-
count: /*#__PURE__*/
|
|
1514
|
+
var depthParser = /*#__PURE__*/object({
|
|
1515
|
+
level: /*#__PURE__*/number(),
|
|
1516
|
+
ask: /*#__PURE__*/number(),
|
|
1517
|
+
bid: /*#__PURE__*/number(),
|
|
1518
|
+
count: /*#__PURE__*/number()
|
|
1510
1519
|
});
|
|
1511
|
-
var getDepthParser = /*#__PURE__*/
|
|
1512
|
-
marketId: /*#__PURE__*/
|
|
1513
|
-
step: /*#__PURE__*/
|
|
1514
|
-
limit: /*#__PURE__*/
|
|
1520
|
+
var getDepthParser = /*#__PURE__*/object({
|
|
1521
|
+
marketId: /*#__PURE__*/string(),
|
|
1522
|
+
step: /*#__PURE__*/string(),
|
|
1523
|
+
limit: /*#__PURE__*/number().or(numTransform)["default"](100).refine(function (n) {
|
|
1515
1524
|
return n <= 250;
|
|
1516
1525
|
}, 'Max limit is 250')
|
|
1517
1526
|
});
|
|
1518
|
-
var dailyParser = /*#__PURE__*/
|
|
1519
|
-
market_id: /*#__PURE__*/
|
|
1520
|
-
first: /*#__PURE__*/
|
|
1521
|
-
last: /*#__PURE__*/
|
|
1522
|
-
bid: /*#__PURE__*/
|
|
1523
|
-
ask: /*#__PURE__*/
|
|
1524
|
-
change_percentage_24hr: /*#__PURE__*/
|
|
1527
|
+
var dailyParser = /*#__PURE__*/object({
|
|
1528
|
+
market_id: /*#__PURE__*/number(),
|
|
1529
|
+
first: /*#__PURE__*/number(),
|
|
1530
|
+
last: /*#__PURE__*/number(),
|
|
1531
|
+
bid: /*#__PURE__*/number(),
|
|
1532
|
+
ask: /*#__PURE__*/number(),
|
|
1533
|
+
change_percentage_24hr: /*#__PURE__*/number()
|
|
1525
1534
|
});
|
|
1526
|
-
var tradeParser = /*#__PURE__*/
|
|
1527
|
-
block_num: /*#__PURE__*/
|
|
1528
|
-
block_time: /*#__PURE__*/
|
|
1529
|
-
trade_id: /*#__PURE__*/
|
|
1530
|
-
market_id: /*#__PURE__*/
|
|
1531
|
-
price: /*#__PURE__*/
|
|
1532
|
-
bid_user: /*#__PURE__*/
|
|
1533
|
-
bid_user_order_id: /*#__PURE__*/
|
|
1534
|
-
bid_amount: /*#__PURE__*/
|
|
1535
|
-
bid_fee: /*#__PURE__*/
|
|
1536
|
-
ask_user: /*#__PURE__*/
|
|
1537
|
-
ask_user_order_id: /*#__PURE__*/
|
|
1538
|
-
ask_amount: /*#__PURE__*/
|
|
1539
|
-
ask_fee: /*#__PURE__*/
|
|
1540
|
-
order_side: /*#__PURE__*/
|
|
1541
|
-
trx_id: /*#__PURE__*/
|
|
1535
|
+
var tradeParser = /*#__PURE__*/object({
|
|
1536
|
+
block_num: /*#__PURE__*/number(),
|
|
1537
|
+
block_time: /*#__PURE__*/string(),
|
|
1538
|
+
trade_id: /*#__PURE__*/number(),
|
|
1539
|
+
market_id: /*#__PURE__*/number(),
|
|
1540
|
+
price: /*#__PURE__*/number(),
|
|
1541
|
+
bid_user: /*#__PURE__*/string(),
|
|
1542
|
+
bid_user_order_id: /*#__PURE__*/number(),
|
|
1543
|
+
bid_amount: /*#__PURE__*/number(),
|
|
1544
|
+
bid_fee: /*#__PURE__*/number(),
|
|
1545
|
+
ask_user: /*#__PURE__*/string(),
|
|
1546
|
+
ask_user_order_id: /*#__PURE__*/number(),
|
|
1547
|
+
ask_amount: /*#__PURE__*/number(),
|
|
1548
|
+
ask_fee: /*#__PURE__*/number(),
|
|
1549
|
+
order_side: /*#__PURE__*/number(),
|
|
1550
|
+
trx_id: /*#__PURE__*/string()
|
|
1542
1551
|
});
|
|
1543
|
-
var getTradesParser = /*#__PURE__*/
|
|
1544
|
-
marketId: /*#__PURE__*/
|
|
1545
|
-
offset: /*#__PURE__*/
|
|
1546
|
-
limit: /*#__PURE__*/
|
|
1552
|
+
var getTradesParser = /*#__PURE__*/object({
|
|
1553
|
+
marketId: /*#__PURE__*/number().or(numTransform),
|
|
1554
|
+
offset: /*#__PURE__*/number().or(numTransform)["default"](0),
|
|
1555
|
+
limit: /*#__PURE__*/number().or(numTransform)["default"](100).refine(function (n) {
|
|
1547
1556
|
return n <= 250;
|
|
1548
1557
|
}, 'Max limit is 250')
|
|
1549
1558
|
});
|
|
1550
|
-
var syncParser = /*#__PURE__*/
|
|
1551
|
-
sourceid: /*#__PURE__*/
|
|
1552
|
-
block_num: /*#__PURE__*/
|
|
1553
|
-
block_time: /*#__PURE__*/
|
|
1554
|
-
irreversible: /*#__PURE__*/
|
|
1555
|
-
is_master: /*#__PURE__*/
|
|
1556
|
-
last_updated: /*#__PURE__*/
|
|
1559
|
+
var syncParser = /*#__PURE__*/object({
|
|
1560
|
+
sourceid: /*#__PURE__*/number(),
|
|
1561
|
+
block_num: /*#__PURE__*/string(),
|
|
1562
|
+
block_time: /*#__PURE__*/string(),
|
|
1563
|
+
irreversible: /*#__PURE__*/string(),
|
|
1564
|
+
is_master: /*#__PURE__*/number(),
|
|
1565
|
+
last_updated: /*#__PURE__*/string()
|
|
1557
1566
|
});
|
|
1558
1567
|
var orderType;
|
|
1559
1568
|
|
|
@@ -1603,9 +1612,9 @@ var TOPICS = (_TOPICS = {}, _TOPICS[ITopics.TRADES] = {
|
|
|
1603
1612
|
topic: ITopics.ORDERS
|
|
1604
1613
|
}, _TOPICS);
|
|
1605
1614
|
|
|
1606
|
-
var loginAccountParamsV3Parser = /*#__PURE__*/
|
|
1607
|
-
email:
|
|
1608
|
-
verificationCode:
|
|
1615
|
+
var loginAccountParamsV3Parser = /*#__PURE__*/object({
|
|
1616
|
+
email: string().optional(),
|
|
1617
|
+
verificationCode: string().optional()
|
|
1609
1618
|
}).merge(generateAuthParser);
|
|
1610
1619
|
|
|
1611
1620
|
var isSameToken = function isSameToken(token1, token2) {
|