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