@rango-dev/queue-manager-rango-preset 0.1.10-next.103 → 0.1.10-next.105
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/actions/checkStatus.d.ts.map +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +34 -42
- package/dist/queue-manager-rango-preset.cjs.development.js.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js.map +1 -1
- package/dist/queue-manager-rango-preset.esm.js +34 -42
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +1 -8
- package/src/actions/checkStatus.ts +0 -1
- package/src/helpers.ts +3 -7
|
@@ -1014,42 +1014,41 @@ function _isNetworkMatchedForTransaction() {
|
|
|
1014
1014
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1015
1015
|
case 0:
|
|
1016
1016
|
if (!isWalletNull(wallet)) {
|
|
1017
|
-
_context2.next =
|
|
1017
|
+
_context2.next = 2;
|
|
1018
1018
|
break;
|
|
1019
1019
|
}
|
|
1020
|
-
console.warn('wallet object is null');
|
|
1021
1020
|
return _context2.abrupt("return", false);
|
|
1022
|
-
case
|
|
1021
|
+
case 2:
|
|
1023
1022
|
fromBlockChain = getCurrentBlockchainOfOrNull(swap, step);
|
|
1024
1023
|
if (fromBlockChain) {
|
|
1025
|
-
_context2.next =
|
|
1024
|
+
_context2.next = 5;
|
|
1026
1025
|
break;
|
|
1027
1026
|
}
|
|
1028
1027
|
return _context2.abrupt("return", false);
|
|
1029
|
-
case
|
|
1028
|
+
case 5:
|
|
1030
1029
|
if (!meta.evmBasedChains.find(function (evmBlochain) {
|
|
1031
1030
|
return evmBlochain.name === fromBlockChain;
|
|
1032
1031
|
})) {
|
|
1033
|
-
_context2.next =
|
|
1032
|
+
_context2.next = 29;
|
|
1034
1033
|
break;
|
|
1035
1034
|
}
|
|
1036
|
-
_context2.prev =
|
|
1035
|
+
_context2.prev = 6;
|
|
1037
1036
|
sourceWallet = swap.wallets[fromBlockChain];
|
|
1038
1037
|
if (!sourceWallet) {
|
|
1039
|
-
_context2.next =
|
|
1038
|
+
_context2.next = 23;
|
|
1040
1039
|
break;
|
|
1041
1040
|
}
|
|
1042
1041
|
if (![WalletType.META_MASK, WalletType.BINANCE_CHAIN, WalletType.XDEFI, WalletType.WALLET_CONNECT, WalletType.TRUST_WALLET, WalletType.COIN98, WalletType.EXODUS, WalletType.OKX, WalletType.COINBASE, WalletType.TOKEN_POCKET, WalletType.MATH, WalletType.SAFEPAL, WalletType.COSMOSTATION, WalletType.CLOVER, WalletType.BRAVE, WalletType.FRONTIER, WalletType.KUCOIN].includes(sourceWallet.walletType)) {
|
|
1043
|
-
_context2.next =
|
|
1042
|
+
_context2.next = 22;
|
|
1044
1043
|
break;
|
|
1045
1044
|
}
|
|
1046
1045
|
provider = getEvmProvider(providers, sourceWallet.walletType);
|
|
1047
|
-
_context2.next =
|
|
1046
|
+
_context2.next = 13;
|
|
1048
1047
|
return getChainId(provider);
|
|
1049
|
-
case
|
|
1048
|
+
case 13:
|
|
1050
1049
|
chainId = _context2.sent;
|
|
1051
1050
|
if (!chainId) {
|
|
1052
|
-
_context2.next =
|
|
1051
|
+
_context2.next = 20;
|
|
1053
1052
|
break;
|
|
1054
1053
|
}
|
|
1055
1054
|
blockChain = getBlockChainNameFromId(chainId, Object.entries(meta.blockchains).map(function (_ref6) {
|
|
@@ -1057,37 +1056,37 @@ function _isNetworkMatchedForTransaction() {
|
|
|
1057
1056
|
return blockchainMeta;
|
|
1058
1057
|
}));
|
|
1059
1058
|
if (!(blockChain && blockChain.toLowerCase() === fromBlockChain.toLowerCase())) {
|
|
1060
|
-
_context2.next =
|
|
1059
|
+
_context2.next = 18;
|
|
1061
1060
|
break;
|
|
1062
1061
|
}
|
|
1063
1062
|
return _context2.abrupt("return", true);
|
|
1064
|
-
case
|
|
1063
|
+
case 18:
|
|
1065
1064
|
if (!(blockChain && blockChain.toLowerCase() !== fromBlockChain.toLowerCase())) {
|
|
1066
|
-
_context2.next =
|
|
1065
|
+
_context2.next = 20;
|
|
1067
1066
|
break;
|
|
1068
1067
|
}
|
|
1069
1068
|
return _context2.abrupt("return", false);
|
|
1070
|
-
case
|
|
1071
|
-
_context2.next =
|
|
1069
|
+
case 20:
|
|
1070
|
+
_context2.next = 23;
|
|
1072
1071
|
break;
|
|
1073
|
-
case
|
|
1072
|
+
case 22:
|
|
1074
1073
|
return _context2.abrupt("return", true);
|
|
1075
|
-
case
|
|
1076
|
-
_context2.next =
|
|
1074
|
+
case 23:
|
|
1075
|
+
_context2.next = 28;
|
|
1077
1076
|
break;
|
|
1078
|
-
case
|
|
1079
|
-
_context2.prev =
|
|
1080
|
-
_context2.t0 = _context2["catch"](
|
|
1077
|
+
case 25:
|
|
1078
|
+
_context2.prev = 25;
|
|
1079
|
+
_context2.t0 = _context2["catch"](6);
|
|
1081
1080
|
console.log(_context2.t0);
|
|
1082
|
-
case
|
|
1081
|
+
case 28:
|
|
1083
1082
|
return _context2.abrupt("return", false);
|
|
1084
|
-
case
|
|
1083
|
+
case 29:
|
|
1085
1084
|
return _context2.abrupt("return", true);
|
|
1086
|
-
case
|
|
1085
|
+
case 30:
|
|
1087
1086
|
case "end":
|
|
1088
1087
|
return _context2.stop();
|
|
1089
1088
|
}
|
|
1090
|
-
}, _callee2, null, [[
|
|
1089
|
+
}, _callee2, null, [[6, 25]]);
|
|
1091
1090
|
}));
|
|
1092
1091
|
return _isNetworkMatchedForTransaction.apply(this, arguments);
|
|
1093
1092
|
}
|
|
@@ -1339,7 +1338,6 @@ function singTransaction(actions) {
|
|
|
1339
1338
|
}, updateResult));
|
|
1340
1339
|
// Execute transaction
|
|
1341
1340
|
walletSigners.getSigner(TransactionType.EVM).signAndSendTx(evmApprovalTransaction, walletAddress, null).then(function (hash) {
|
|
1342
|
-
console.debug('transaction of approval minted successfully', hash);
|
|
1343
1341
|
var approveUrl = getEvmApproveUrl(hash, getCurrentBlockchainOf(swap, currentStep), meta.evmBasedChains);
|
|
1344
1342
|
setStepTransactionIds(actions, hash, notifier, 'check_approve_tx_status', approveUrl);
|
|
1345
1343
|
schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
|
|
@@ -1348,7 +1346,6 @@ function singTransaction(actions) {
|
|
|
1348
1346
|
}, function (error) {
|
|
1349
1347
|
var _error$root, _error$root2, _error$root3;
|
|
1350
1348
|
if (swap.status === 'failed') return;
|
|
1351
|
-
console.debug('error in approving', error);
|
|
1352
1349
|
var _prettifyErrorMessage = prettifyErrorMessage(error),
|
|
1353
1350
|
extraMessage = _prettifyErrorMessage.extraMessage,
|
|
1354
1351
|
extraMessageDetail = _prettifyErrorMessage.extraMessageDetail,
|
|
@@ -1387,7 +1384,6 @@ function singTransaction(actions) {
|
|
|
1387
1384
|
}, _updateResult));
|
|
1388
1385
|
// Execute transaction
|
|
1389
1386
|
walletSigners.getSigner(TransactionType.TRON).signAndSendTx(tronApprovalTransaction, walletAddress, null).then(function (hash) {
|
|
1390
|
-
console.debug('transaction of approval minted successfully', hash);
|
|
1391
1387
|
var approveUrl = getTronApproveUrl(hash);
|
|
1392
1388
|
setStepTransactionIds(actions, hash, notifier, 'check_approve_tx_status', approveUrl);
|
|
1393
1389
|
schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
|
|
@@ -1396,7 +1392,6 @@ function singTransaction(actions) {
|
|
|
1396
1392
|
}, function (error) {
|
|
1397
1393
|
var _error$root4, _error$root5, _error$root6;
|
|
1398
1394
|
if (swap.status === 'failed') return;
|
|
1399
|
-
console.debug('error in approving', error);
|
|
1400
1395
|
var _prettifyErrorMessage2 = prettifyErrorMessage(error),
|
|
1401
1396
|
extraMessage = _prettifyErrorMessage2.extraMessage,
|
|
1402
1397
|
extraMessageDetail = _prettifyErrorMessage2.extraMessageDetail,
|
|
@@ -1435,7 +1430,6 @@ function singTransaction(actions) {
|
|
|
1435
1430
|
}, _updateResult2));
|
|
1436
1431
|
// Execute transaction
|
|
1437
1432
|
walletSigners.getSigner(TransactionType.STARKNET).signAndSendTx(starknetApprovalTransaction, walletAddress, null).then(function (hash) {
|
|
1438
|
-
console.debug('transaction of approval minted successfully', hash);
|
|
1439
1433
|
var approveUrl = getStarknetApproveUrl(hash);
|
|
1440
1434
|
setStepTransactionIds(actions, hash, notifier, 'check_approve_tx_status', approveUrl);
|
|
1441
1435
|
schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
|
|
@@ -1444,7 +1438,6 @@ function singTransaction(actions) {
|
|
|
1444
1438
|
}, function (error) {
|
|
1445
1439
|
var _error$root7, _error$root8, _error$root9;
|
|
1446
1440
|
if (swap.status === 'failed') return;
|
|
1447
|
-
console.debug('error in approving', error);
|
|
1448
1441
|
var _prettifyErrorMessage3 = prettifyErrorMessage(error),
|
|
1449
1442
|
extraMessage = _prettifyErrorMessage3.extraMessage,
|
|
1450
1443
|
extraMessageDetail = _prettifyErrorMessage3.extraMessageDetail,
|
|
@@ -2207,16 +2200,15 @@ function _checkApprovalStatus() {
|
|
|
2207
2200
|
step: currentStep
|
|
2208
2201
|
});
|
|
2209
2202
|
}
|
|
2210
|
-
_context2.next =
|
|
2203
|
+
_context2.next = 15;
|
|
2211
2204
|
break;
|
|
2212
2205
|
case 12:
|
|
2213
2206
|
_context2.prev = 12;
|
|
2214
2207
|
_context2.t0 = _context2["catch"](4);
|
|
2215
|
-
console.error('Failed to check getApprovedAmount', _context2.t0);
|
|
2216
2208
|
isApproved = false;
|
|
2217
|
-
case
|
|
2209
|
+
case 15:
|
|
2218
2210
|
if (!isApproved) {
|
|
2219
|
-
_context2.next =
|
|
2211
|
+
_context2.next = 31;
|
|
2220
2212
|
break;
|
|
2221
2213
|
}
|
|
2222
2214
|
currentStep.status = 'approved';
|
|
@@ -2238,14 +2230,14 @@ function _checkApprovalStatus() {
|
|
|
2238
2230
|
});
|
|
2239
2231
|
schedule(SwapActionTypes.SCHEDULE_NEXT_STEP);
|
|
2240
2232
|
next();
|
|
2241
|
-
_context2.next = 35;
|
|
2242
|
-
break;
|
|
2243
|
-
case 32:
|
|
2244
2233
|
_context2.next = 34;
|
|
2234
|
+
break;
|
|
2235
|
+
case 31:
|
|
2236
|
+
_context2.next = 33;
|
|
2245
2237
|
return delay(2000);
|
|
2246
|
-
case
|
|
2238
|
+
case 33:
|
|
2247
2239
|
retry();
|
|
2248
|
-
case
|
|
2240
|
+
case 34:
|
|
2249
2241
|
case "end":
|
|
2250
2242
|
return _context2.stop();
|
|
2251
2243
|
}
|