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