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