@rango-dev/queue-manager-rango-preset 0.1.15-next.6 → 0.1.15-next.8
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 +14 -4
- package/dist/helpers.d.ts.map +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +136 -115
- 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 +136 -115
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/actions/checkStatus.ts +69 -34
- package/src/helpers.ts +53 -36
- package/src/hooks.ts +6 -1
- package/src/types.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../src/actions/checkStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUhE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../src/actions/checkStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUhE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA0X1E;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -19,9 +19,19 @@ export declare function claimQueue(): {
|
|
|
19
19
|
setClaimer: (queue_id: string) => void;
|
|
20
20
|
reset: () => void;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* We use module-level variable to keep track of
|
|
25
|
+
* map of transactions hash to the TransactionResponse and ...
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
declare type TransactionData = {
|
|
29
|
+
response?: any;
|
|
30
|
+
receiptReceived?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare function useTransactionsData(): {
|
|
33
|
+
getTransactionDataByHash: (hash: string) => TransactionData;
|
|
34
|
+
setTransactionDataByHash: (hash: string, data: TransactionData) => void;
|
|
25
35
|
};
|
|
26
36
|
/**
|
|
27
37
|
* Sample inputs are:
|
|
@@ -220,7 +230,7 @@ export declare function resetRunningSwapNotifsOnPageLoad(runningSwaps: PendingSw
|
|
|
220
230
|
* @param manager
|
|
221
231
|
* @returns
|
|
222
232
|
*/
|
|
223
|
-
export declare function retryOn(wallet_network: string, notifier: SwapQueueContext['notifier'], manager?: Manager, options?: {
|
|
233
|
+
export declare function retryOn(wallet_network: string, notifier: SwapQueueContext['notifier'], manager?: Manager, canSwitchNetworkTo?: (type: WalletType, network: Network) => boolean, options?: {
|
|
224
234
|
fallbackToOnlyWallet: boolean;
|
|
225
235
|
}): void;
|
|
226
236
|
export declare function isNeedBlockQueueForParallel(step: PendingSwapStep): boolean;
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EAGV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,I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,GAAG,IAAI,CAgCpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAW/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,WAAW,EAAE,EAC3B,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,QAkBvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,EACtC,OAAO,CAAC,EAAE,OAAO,EACjB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,EACpE,OAAO;;CAAiC,GACvC,IAAI,CAwDN;AAMD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAE1E;AAMD,wBAAsB,SAAS,CAC7B,WAAW,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAC9C,OAAO,CAAC,yBAAyB,CAAC,CAQpC;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,EACf,OAAO,CAAC,EAAE,OAAO,GAChB;IACD,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9B,CAkBA"}
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;GAKG;AACH,iBAAS,YAAY,IAAI;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAmBA;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;GAKG;AACH,iBAAS,YAAY,IAAI;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAmBA;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CA+B5D;AAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -833,20 +833,17 @@ function claimQueue() {
|
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
* We use module-level variable to keep track of
|
|
839
|
-
* map of transactions hash to the TransactionResponse
|
|
840
|
-
*
|
|
841
|
-
*/
|
|
842
|
-
var swapTransactionToResponseMap = {};
|
|
843
|
-
function useTransactionsResponse() {
|
|
836
|
+
var swapTransactionToDataMap = {};
|
|
837
|
+
function useTransactionsData() {
|
|
844
838
|
return {
|
|
845
|
-
|
|
846
|
-
return
|
|
839
|
+
getTransactionDataByHash: function getTransactionDataByHash(hash) {
|
|
840
|
+
return swapTransactionToDataMap[hash] || {};
|
|
847
841
|
},
|
|
848
|
-
|
|
849
|
-
|
|
842
|
+
setTransactionDataByHash: function setTransactionDataByHash(hash, data) {
|
|
843
|
+
var r = swapTransactionToDataMap[hash];
|
|
844
|
+
if (!r) swapTransactionToDataMap[hash] = {};
|
|
845
|
+
swapTransactionToDataMap[hash].response = data.response || swapTransactionToDataMap[hash].response;
|
|
846
|
+
swapTransactionToDataMap[hash].receiptReceived = data.receiptReceived || swapTransactionToDataMap[hash].receiptReceived || false;
|
|
850
847
|
}
|
|
851
848
|
};
|
|
852
849
|
}
|
|
@@ -964,7 +961,7 @@ function updateSwapStatus(_ref) {
|
|
|
964
961
|
var swap = getStorage().swapDetails;
|
|
965
962
|
var currentStep = getCurrentStep(swap);
|
|
966
963
|
if (!!nextStepStatus && !!currentStep) currentStep.status = nextStepStatus;
|
|
967
|
-
if (
|
|
964
|
+
if (nextStatus) swap.status = nextStatus;
|
|
968
965
|
swap.hasAlreadyProceededToSign = hasAlreadyProceededToSign;
|
|
969
966
|
if (!!nextStatus && ['failed', 'success'].includes(nextStatus)) swap.finishTime = new Date().getTime().toString();
|
|
970
967
|
if (!!message || !!details) {
|
|
@@ -1010,7 +1007,7 @@ function setStepTransactionIds(_ref2, txId, notifier, eventType, explorerUrl) {
|
|
|
1010
1007
|
var currentStep = getCurrentStep(swap);
|
|
1011
1008
|
currentStep.executedTransactionId = txId;
|
|
1012
1009
|
currentStep.executedTransactionTime = new Date().getTime().toString();
|
|
1013
|
-
if (
|
|
1010
|
+
if (explorerUrl != null && explorerUrl.url) currentStep.explorerUrl = [].concat(currentStep.explorerUrl || [], [{
|
|
1014
1011
|
url: explorerUrl.url,
|
|
1015
1012
|
description: explorerUrl.description || null
|
|
1016
1013
|
}]);
|
|
@@ -1026,7 +1023,7 @@ function setStepTransactionIds(_ref2, txId, notifier, eventType, explorerUrl) {
|
|
|
1026
1023
|
setStorage(_extends({}, getStorage(), {
|
|
1027
1024
|
swapDetails: swap
|
|
1028
1025
|
}));
|
|
1029
|
-
if (
|
|
1026
|
+
if (eventType) notifier({
|
|
1030
1027
|
eventType: eventType,
|
|
1031
1028
|
swap: swap,
|
|
1032
1029
|
step: currentStep
|
|
@@ -1397,16 +1394,18 @@ function onBlockForChangeNetwork(_event, meta) {
|
|
|
1397
1394
|
type = _getRequiredWallet2.type,
|
|
1398
1395
|
network = _getRequiredWallet2.network;
|
|
1399
1396
|
if (!!type && !!network) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1397
|
+
if (context.canSwitchNetworkTo(type, network)) {
|
|
1398
|
+
var _result = context.switchNetwork(type, network);
|
|
1399
|
+
if (_result) {
|
|
1400
|
+
_result.then(function () {
|
|
1401
|
+
queue.unblock();
|
|
1402
|
+
})["catch"](function (error) {
|
|
1403
|
+
// ignore switch network errors
|
|
1404
|
+
console.log({
|
|
1405
|
+
error: error
|
|
1406
|
+
});
|
|
1408
1407
|
});
|
|
1409
|
-
}
|
|
1408
|
+
}
|
|
1410
1409
|
}
|
|
1411
1410
|
}
|
|
1412
1411
|
}
|
|
@@ -1468,7 +1467,7 @@ function onDependsOnOtherQueues(_event, meta) {
|
|
|
1468
1467
|
resetClaimedBy: function resetClaimedBy() {
|
|
1469
1468
|
reset();
|
|
1470
1469
|
// TODO: Use key generator
|
|
1471
|
-
retryOn(type + "-" + network + ":" + address, context.notifier, manager);
|
|
1470
|
+
retryOn(type + "-" + network + ":" + address, context.notifier, manager, context.canSwitchNetworkTo);
|
|
1472
1471
|
}
|
|
1473
1472
|
});
|
|
1474
1473
|
}
|
|
@@ -1501,8 +1500,8 @@ function isRequiredWalletConnected(swap, getState) {
|
|
|
1501
1500
|
};
|
|
1502
1501
|
}
|
|
1503
1502
|
function singTransaction(actions) {
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1503
|
+
var _useTransactionsData = useTransactionsData(),
|
|
1504
|
+
setTransactionDataByHash = _useTransactionsData.setTransactionDataByHash;
|
|
1506
1505
|
var getStorage = actions.getStorage,
|
|
1507
1506
|
setStorage = actions.setStorage,
|
|
1508
1507
|
failed = actions.failed,
|
|
@@ -1580,7 +1579,9 @@ function singTransaction(actions) {
|
|
|
1580
1579
|
description: isApproval ? 'Approve' : 'Swap'
|
|
1581
1580
|
} : undefined);
|
|
1582
1581
|
// response used for evm transactions to get receipt and track replaced
|
|
1583
|
-
response &&
|
|
1582
|
+
response && setTransactionDataByHash(hash, {
|
|
1583
|
+
response: response
|
|
1584
|
+
});
|
|
1584
1585
|
schedule(SwapActionTypes.CHECK_TRANSACTION_STATUS);
|
|
1585
1586
|
next();
|
|
1586
1587
|
onFinish();
|
|
@@ -1743,8 +1744,8 @@ function resetRunningSwapNotifsOnPageLoad(runningSwaps, notifier) {
|
|
|
1743
1744
|
* @param manager
|
|
1744
1745
|
* @returns
|
|
1745
1746
|
*/
|
|
1746
|
-
function retryOn(wallet_network, notifier, manager, options) {
|
|
1747
|
-
var _finalQueueToBeRun;
|
|
1747
|
+
function retryOn(wallet_network, notifier, manager, canSwitchNetworkTo, options) {
|
|
1748
|
+
var _finalQueueToBeRun, _finalQueueToBeRun2;
|
|
1748
1749
|
if (options === void 0) {
|
|
1749
1750
|
options = {
|
|
1750
1751
|
fallbackToOnlyWallet: true
|
|
@@ -1792,7 +1793,7 @@ function retryOn(wallet_network, notifier, manager, options) {
|
|
|
1792
1793
|
} else if (onlyWalletMatched.length > 0 && options.fallbackToOnlyWallet) {
|
|
1793
1794
|
finalQueueToBeRun = onlyWalletMatched[0];
|
|
1794
1795
|
}
|
|
1795
|
-
(_finalQueueToBeRun = finalQueueToBeRun) == null ? void 0 : _finalQueueToBeRun.checkBlock();
|
|
1796
|
+
if (!(canSwitchNetworkTo != null && canSwitchNetworkTo(wallet, network))) (_finalQueueToBeRun = finalQueueToBeRun) == null ? void 0 : _finalQueueToBeRun.unblock();else (_finalQueueToBeRun2 = finalQueueToBeRun) == null ? void 0 : _finalQueueToBeRun2.checkBlock();
|
|
1796
1797
|
}
|
|
1797
1798
|
/*
|
|
1798
1799
|
For avoiding conflict by making too many requests to wallet, we need to make sure
|
|
@@ -1814,27 +1815,22 @@ function _throwOnOK() {
|
|
|
1814
1815
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1815
1816
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1816
1817
|
case 0:
|
|
1817
|
-
_context3.
|
|
1818
|
-
_context3.next = 3;
|
|
1818
|
+
_context3.next = 2;
|
|
1819
1819
|
return rawResponse;
|
|
1820
|
-
case
|
|
1820
|
+
case 2:
|
|
1821
1821
|
responseBody = _context3.sent;
|
|
1822
1822
|
if (!(!responseBody.ok || !responseBody.transaction)) {
|
|
1823
|
-
_context3.next =
|
|
1823
|
+
_context3.next = 5;
|
|
1824
1824
|
break;
|
|
1825
1825
|
}
|
|
1826
1826
|
throw PrettyError.CreateTransaction(responseBody.error || 'bad response from create tx endpoint');
|
|
1827
|
-
case
|
|
1827
|
+
case 5:
|
|
1828
1828
|
return _context3.abrupt("return", responseBody);
|
|
1829
|
-
case
|
|
1830
|
-
_context3.prev = 9;
|
|
1831
|
-
_context3.t0 = _context3["catch"](0);
|
|
1832
|
-
throw _context3.t0;
|
|
1833
|
-
case 12:
|
|
1829
|
+
case 6:
|
|
1834
1830
|
case "end":
|
|
1835
1831
|
return _context3.stop();
|
|
1836
1832
|
}
|
|
1837
|
-
}, _callee3
|
|
1833
|
+
}, _callee3);
|
|
1838
1834
|
}));
|
|
1839
1835
|
return _throwOnOK.apply(this, arguments);
|
|
1840
1836
|
}
|
|
@@ -1871,7 +1867,7 @@ function checkTransactionStatus(_x) {
|
|
|
1871
1867
|
function _checkTransactionStatus() {
|
|
1872
1868
|
_checkTransactionStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
1873
1869
|
var _status, _status2, _status3, _status4, _status5, _status6, _status7, _status9, _status10, _status11;
|
|
1874
|
-
var getStorage, setStorage, next, schedule, retry, failed, context, swap, meta, currentStep, txId, getTxReceiptFailed, status, signer,
|
|
1870
|
+
var getStorage, setStorage, next, schedule, retry, failed, context, swap, meta, currentStep, txId, getTxReceiptFailed, status, signer, _useTransactionsData, getTransactionDataByHash, setTransactionDataByHash, txType, sourceWallet, _signer, _getTransactionDataBy, txResponse, receiptReceived, _yield$signer$wait, updatedTxHash, updatedTxResponse, currentStepBlockchain, explorerUrl, _currentStep$explorer, _prettifyErrorMessage, extraMessage, extraMessageDetail, extraMessageErrorCode, updateResult, outputAmount, prevOutputAmount, newTransaction, nextStep, _status8;
|
|
1875
1871
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1876
1872
|
while (1) switch (_context.prev = _context.next) {
|
|
1877
1873
|
case 0:
|
|
@@ -1879,11 +1875,17 @@ function _checkTransactionStatus() {
|
|
|
1879
1875
|
swap = getStorage().swapDetails;
|
|
1880
1876
|
meta = context.meta; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1881
1877
|
currentStep = getCurrentStep(swap);
|
|
1878
|
+
if (currentStep != null && currentStep.executedTransactionId) {
|
|
1879
|
+
_context.next = 6;
|
|
1880
|
+
break;
|
|
1881
|
+
}
|
|
1882
|
+
return _context.abrupt("return");
|
|
1883
|
+
case 6:
|
|
1882
1884
|
txId = currentStep.executedTransactionId;
|
|
1883
1885
|
getTxReceiptFailed = false;
|
|
1884
1886
|
status = null;
|
|
1885
1887
|
signer = null;
|
|
1886
|
-
|
|
1888
|
+
_useTransactionsData = useTransactionsData(), getTransactionDataByHash = _useTransactionsData.getTransactionDataByHash, setTransactionDataByHash = _useTransactionsData.setTransactionDataByHash;
|
|
1887
1889
|
try {
|
|
1888
1890
|
txType = getCurrentStepTxType(currentStep);
|
|
1889
1891
|
sourceWallet = getRelatedWallet(swap, currentStep);
|
|
@@ -1892,15 +1894,16 @@ function _checkTransactionStatus() {
|
|
|
1892
1894
|
// wallet is not connected yet
|
|
1893
1895
|
// no need to do anything
|
|
1894
1896
|
}
|
|
1895
|
-
_context.prev =
|
|
1896
|
-
if
|
|
1897
|
-
|
|
1897
|
+
_context.prev = 12;
|
|
1898
|
+
// if wallet is connected, try to get transaction reciept
|
|
1899
|
+
_getTransactionDataBy = getTransactionDataByHash(txId), txResponse = _getTransactionDataBy.response, receiptReceived = _getTransactionDataBy.receiptReceived;
|
|
1900
|
+
if (!((_signer = signer) != null && _signer.wait && !receiptReceived)) {
|
|
1901
|
+
_context.next = 21;
|
|
1898
1902
|
break;
|
|
1899
1903
|
}
|
|
1900
|
-
|
|
1901
|
-
_context.next = 15;
|
|
1904
|
+
_context.next = 17;
|
|
1902
1905
|
return signer.wait(txId, txResponse);
|
|
1903
|
-
case
|
|
1906
|
+
case 17:
|
|
1904
1907
|
_yield$signer$wait = _context.sent;
|
|
1905
1908
|
updatedTxHash = _yield$signer$wait.hash;
|
|
1906
1909
|
updatedTxResponse = _yield$signer$wait.response;
|
|
@@ -1917,14 +1920,20 @@ function _checkTransactionStatus() {
|
|
|
1917
1920
|
}
|
|
1918
1921
|
}
|
|
1919
1922
|
txId = currentStep.executedTransactionId;
|
|
1920
|
-
if (updatedTxHash && updatedTxResponse)
|
|
1923
|
+
if (updatedTxHash && updatedTxResponse) setTransactionDataByHash(updatedTxHash, {
|
|
1924
|
+
response: updatedTxResponse
|
|
1925
|
+
});
|
|
1926
|
+
} else {
|
|
1927
|
+
setTransactionDataByHash(updatedTxHash, {
|
|
1928
|
+
receiptReceived: true
|
|
1929
|
+
});
|
|
1921
1930
|
}
|
|
1922
|
-
case 19:
|
|
1923
|
-
_context.next = 27;
|
|
1924
|
-
break;
|
|
1925
1931
|
case 21:
|
|
1926
|
-
_context.
|
|
1927
|
-
|
|
1932
|
+
_context.next = 29;
|
|
1933
|
+
break;
|
|
1934
|
+
case 23:
|
|
1935
|
+
_context.prev = 23;
|
|
1936
|
+
_context.t0 = _context["catch"](12);
|
|
1928
1937
|
_prettifyErrorMessage = prettifyErrorMessage(_context.t0), extraMessage = _prettifyErrorMessage.extraMessage, extraMessageDetail = _prettifyErrorMessage.extraMessageDetail, extraMessageErrorCode = _prettifyErrorMessage.extraMessageErrorCode;
|
|
1929
1938
|
updateResult = updateSwapStatus({
|
|
1930
1939
|
getStorage: getStorage,
|
|
@@ -1941,39 +1950,39 @@ function _checkTransactionStatus() {
|
|
|
1941
1950
|
getTxReceiptFailed = true;
|
|
1942
1951
|
// We shouldn't return here, because we need to trigger check status job in backend.
|
|
1943
1952
|
// This is not a ui requirement but the backend one.
|
|
1944
|
-
case
|
|
1945
|
-
_context.prev =
|
|
1946
|
-
_context.next =
|
|
1953
|
+
case 29:
|
|
1954
|
+
_context.prev = 29;
|
|
1955
|
+
_context.next = 32;
|
|
1947
1956
|
return httpService().checkStatus({
|
|
1948
1957
|
requestId: swap.requestId,
|
|
1949
1958
|
txId: txId,
|
|
1950
1959
|
step: currentStep.id
|
|
1951
1960
|
});
|
|
1952
|
-
case
|
|
1961
|
+
case 32:
|
|
1953
1962
|
status = _context.sent;
|
|
1954
|
-
_context.next =
|
|
1963
|
+
_context.next = 41;
|
|
1955
1964
|
break;
|
|
1956
|
-
case
|
|
1957
|
-
_context.prev =
|
|
1958
|
-
_context.t1 = _context["catch"](
|
|
1959
|
-
_context.next =
|
|
1965
|
+
case 35:
|
|
1966
|
+
_context.prev = 35;
|
|
1967
|
+
_context.t1 = _context["catch"](29);
|
|
1968
|
+
_context.next = 39;
|
|
1960
1969
|
return delay(INTERVAL_FOR_CHECK);
|
|
1961
|
-
case
|
|
1970
|
+
case 39:
|
|
1962
1971
|
retry();
|
|
1963
1972
|
return _context.abrupt("return");
|
|
1964
|
-
case
|
|
1973
|
+
case 41:
|
|
1965
1974
|
if (!getTxReceiptFailed) {
|
|
1966
|
-
_context.next =
|
|
1975
|
+
_context.next = 43;
|
|
1967
1976
|
break;
|
|
1968
1977
|
}
|
|
1969
1978
|
return _context.abrupt("return", failed());
|
|
1970
|
-
case
|
|
1979
|
+
case 43:
|
|
1971
1980
|
if (!((currentStep == null ? void 0 : currentStep.status) === 'failed')) {
|
|
1972
|
-
_context.next =
|
|
1981
|
+
_context.next = 45;
|
|
1973
1982
|
break;
|
|
1974
1983
|
}
|
|
1975
1984
|
return _context.abrupt("return");
|
|
1976
|
-
case
|
|
1985
|
+
case 45:
|
|
1977
1986
|
outputAmount = ((_status = status) == null ? void 0 : _status.outputAmount) || (currentStep.outputAmount ? currentStep.outputAmount : null);
|
|
1978
1987
|
prevOutputAmount = currentStep.outputAmount || null;
|
|
1979
1988
|
swap.extraMessage = ((_status2 = status) == null ? void 0 : _status2.extraMessage) || swap.extraMessage;
|
|
@@ -2019,31 +2028,31 @@ function _checkTransactionStatus() {
|
|
|
2019
2028
|
swapDetails: swap
|
|
2020
2029
|
}));
|
|
2021
2030
|
if (!(((_status9 = status) == null ? void 0 : _status9.status) === 'failed')) {
|
|
2022
|
-
_context.next =
|
|
2031
|
+
_context.next = 64;
|
|
2023
2032
|
break;
|
|
2024
2033
|
}
|
|
2025
2034
|
failed();
|
|
2026
|
-
_context.next =
|
|
2035
|
+
_context.next = 72;
|
|
2027
2036
|
break;
|
|
2028
|
-
case
|
|
2037
|
+
case 64:
|
|
2029
2038
|
if (!(((_status10 = status) == null ? void 0 : _status10.status) === 'success' || ((_status11 = status) == null ? void 0 : _status11.status) === 'running' && !!status.newTx)) {
|
|
2030
|
-
_context.next =
|
|
2039
|
+
_context.next = 69;
|
|
2031
2040
|
break;
|
|
2032
2041
|
}
|
|
2033
2042
|
schedule(SwapActionTypes.SCHEDULE_NEXT_STEP);
|
|
2034
2043
|
next();
|
|
2035
|
-
_context.next =
|
|
2044
|
+
_context.next = 72;
|
|
2036
2045
|
break;
|
|
2037
|
-
case 67:
|
|
2038
|
-
_context.next = 69;
|
|
2039
|
-
return delay(INTERVAL_FOR_CHECK);
|
|
2040
2046
|
case 69:
|
|
2047
|
+
_context.next = 71;
|
|
2048
|
+
return delay(INTERVAL_FOR_CHECK);
|
|
2049
|
+
case 71:
|
|
2041
2050
|
retry();
|
|
2042
|
-
case
|
|
2051
|
+
case 72:
|
|
2043
2052
|
case "end":
|
|
2044
2053
|
return _context.stop();
|
|
2045
2054
|
}
|
|
2046
|
-
}, _callee, null, [[
|
|
2055
|
+
}, _callee, null, [[12, 23], [29, 35]]);
|
|
2047
2056
|
}));
|
|
2048
2057
|
return _checkTransactionStatus.apply(this, arguments);
|
|
2049
2058
|
}
|
|
@@ -2060,14 +2069,14 @@ function checkApprovalStatus(_x2) {
|
|
|
2060
2069
|
*/
|
|
2061
2070
|
function _checkApprovalStatus() {
|
|
2062
2071
|
_checkApprovalStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
|
2063
|
-
var getStorage, setStorage, next, schedule, retry, failed, context, swap, meta,
|
|
2072
|
+
var getStorage, setStorage, next, schedule, retry, failed, context, swap, meta, _useTransactionsData2, getTransactionDataByHash, setTransactionDataByHash, currentStep, txId, signer, txType, sourceWallet, _signer2, _getTransactionDataBy2, txResponse, receiptReceived, _yield$signer$wait2, updatedTxHash, updatedTxResponse, currentStepBlockchain, explorerUrl, _currentStep$explorer2, _prettifyErrorMessage2, extraMessage, extraMessageDetail, extraMessageErrorCode, updateResult, isApproved, response, message, details, _updateResult;
|
|
2064
2073
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2065
2074
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2066
2075
|
case 0:
|
|
2067
2076
|
getStorage = _ref2.getStorage, setStorage = _ref2.setStorage, next = _ref2.next, schedule = _ref2.schedule, retry = _ref2.retry, failed = _ref2.failed, context = _ref2.context;
|
|
2068
2077
|
swap = getStorage().swapDetails;
|
|
2069
2078
|
meta = context.meta;
|
|
2070
|
-
|
|
2079
|
+
_useTransactionsData2 = useTransactionsData(), getTransactionDataByHash = _useTransactionsData2.getTransactionDataByHash, setTransactionDataByHash = _useTransactionsData2.setTransactionDataByHash;
|
|
2071
2080
|
currentStep = getCurrentStep(swap);
|
|
2072
2081
|
if (currentStep) {
|
|
2073
2082
|
_context2.next = 8;
|
|
@@ -2076,6 +2085,12 @@ function _checkApprovalStatus() {
|
|
|
2076
2085
|
console.log('ignore check status, current step is null');
|
|
2077
2086
|
return _context2.abrupt("return");
|
|
2078
2087
|
case 8:
|
|
2088
|
+
if (currentStep != null && currentStep.executedTransactionId) {
|
|
2089
|
+
_context2.next = 10;
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
2092
|
+
return _context2.abrupt("return");
|
|
2093
|
+
case 10:
|
|
2079
2094
|
txId = currentStep.executedTransactionId;
|
|
2080
2095
|
signer = null;
|
|
2081
2096
|
try {
|
|
@@ -2086,15 +2101,15 @@ function _checkApprovalStatus() {
|
|
|
2086
2101
|
// wallet is not connected yet
|
|
2087
2102
|
// no need to do anything
|
|
2088
2103
|
}
|
|
2089
|
-
_context2.prev =
|
|
2090
|
-
|
|
2091
|
-
|
|
2104
|
+
_context2.prev = 13;
|
|
2105
|
+
_getTransactionDataBy2 = getTransactionDataByHash(txId), txResponse = _getTransactionDataBy2.response, receiptReceived = _getTransactionDataBy2.receiptReceived; // if wallet is connected, try to get transaction reciept
|
|
2106
|
+
if (!((_signer2 = signer) != null && _signer2.wait && !receiptReceived)) {
|
|
2107
|
+
_context2.next = 22;
|
|
2092
2108
|
break;
|
|
2093
2109
|
}
|
|
2094
|
-
|
|
2095
|
-
_context2.next = 16;
|
|
2110
|
+
_context2.next = 18;
|
|
2096
2111
|
return signer.wait(txId, txResponse);
|
|
2097
|
-
case
|
|
2112
|
+
case 18:
|
|
2098
2113
|
_yield$signer$wait2 = _context2.sent;
|
|
2099
2114
|
updatedTxHash = _yield$signer$wait2.hash;
|
|
2100
2115
|
updatedTxResponse = _yield$signer$wait2.response;
|
|
@@ -2111,14 +2126,20 @@ function _checkApprovalStatus() {
|
|
|
2111
2126
|
}
|
|
2112
2127
|
}
|
|
2113
2128
|
txId = currentStep.executedTransactionId;
|
|
2114
|
-
if (updatedTxHash && updatedTxResponse)
|
|
2129
|
+
if (updatedTxHash && updatedTxResponse) setTransactionDataByHash(updatedTxHash, {
|
|
2130
|
+
response: updatedTxResponse
|
|
2131
|
+
});
|
|
2132
|
+
} else {
|
|
2133
|
+
setTransactionDataByHash(updatedTxHash, {
|
|
2134
|
+
receiptReceived: true
|
|
2135
|
+
});
|
|
2115
2136
|
}
|
|
2116
|
-
case 20:
|
|
2117
|
-
_context2.next = 28;
|
|
2118
|
-
break;
|
|
2119
2137
|
case 22:
|
|
2120
|
-
_context2.
|
|
2121
|
-
|
|
2138
|
+
_context2.next = 30;
|
|
2139
|
+
break;
|
|
2140
|
+
case 24:
|
|
2141
|
+
_context2.prev = 24;
|
|
2142
|
+
_context2.t0 = _context2["catch"](13);
|
|
2122
2143
|
_prettifyErrorMessage2 = prettifyErrorMessage(_context2.t0), extraMessage = _prettifyErrorMessage2.extraMessage, extraMessageDetail = _prettifyErrorMessage2.extraMessageDetail, extraMessageErrorCode = _prettifyErrorMessage2.extraMessageErrorCode;
|
|
2123
2144
|
updateResult = updateSwapStatus({
|
|
2124
2145
|
getStorage: getStorage,
|
|
@@ -2133,19 +2154,19 @@ function _checkApprovalStatus() {
|
|
|
2133
2154
|
eventType: 'task_failed'
|
|
2134
2155
|
}, updateResult));
|
|
2135
2156
|
return _context2.abrupt("return", failed());
|
|
2136
|
-
case
|
|
2157
|
+
case 30:
|
|
2137
2158
|
isApproved = false;
|
|
2138
|
-
_context2.prev =
|
|
2139
|
-
_context2.next =
|
|
2140
|
-
return httpService().checkApproval(swap.requestId, currentStep.executedTransactionId
|
|
2141
|
-
case
|
|
2159
|
+
_context2.prev = 31;
|
|
2160
|
+
_context2.next = 34;
|
|
2161
|
+
return httpService().checkApproval(swap.requestId, currentStep.executedTransactionId);
|
|
2162
|
+
case 34:
|
|
2142
2163
|
response = _context2.sent;
|
|
2143
2164
|
if (!((currentStep == null ? void 0 : currentStep.status) === 'failed')) {
|
|
2144
|
-
_context2.next =
|
|
2165
|
+
_context2.next = 37;
|
|
2145
2166
|
break;
|
|
2146
2167
|
}
|
|
2147
2168
|
return _context2.abrupt("return");
|
|
2148
|
-
case
|
|
2169
|
+
case 37:
|
|
2149
2170
|
isApproved = response.isApproved;
|
|
2150
2171
|
if (!isApproved && (response.txStatus === 'failed' || response.txStatus === 'success')) {
|
|
2151
2172
|
if (response.txStatus === 'failed') {
|
|
@@ -2178,15 +2199,15 @@ function _checkApprovalStatus() {
|
|
|
2178
2199
|
step: currentStep
|
|
2179
2200
|
});
|
|
2180
2201
|
}
|
|
2181
|
-
_context2.next =
|
|
2202
|
+
_context2.next = 44;
|
|
2182
2203
|
break;
|
|
2183
|
-
case
|
|
2184
|
-
_context2.prev =
|
|
2185
|
-
_context2.t1 = _context2["catch"](
|
|
2204
|
+
case 41:
|
|
2205
|
+
_context2.prev = 41;
|
|
2206
|
+
_context2.t1 = _context2["catch"](31);
|
|
2186
2207
|
isApproved = false;
|
|
2187
|
-
case
|
|
2208
|
+
case 44:
|
|
2188
2209
|
if (!isApproved) {
|
|
2189
|
-
_context2.next =
|
|
2210
|
+
_context2.next = 60;
|
|
2190
2211
|
break;
|
|
2191
2212
|
}
|
|
2192
2213
|
currentStep.status = 'approved';
|
|
@@ -2208,18 +2229,18 @@ function _checkApprovalStatus() {
|
|
|
2208
2229
|
});
|
|
2209
2230
|
schedule(SwapActionTypes.SCHEDULE_NEXT_STEP);
|
|
2210
2231
|
next();
|
|
2211
|
-
_context2.next =
|
|
2232
|
+
_context2.next = 63;
|
|
2212
2233
|
break;
|
|
2213
|
-
case 58:
|
|
2214
|
-
_context2.next = 60;
|
|
2215
|
-
return delay(2000);
|
|
2216
2234
|
case 60:
|
|
2235
|
+
_context2.next = 62;
|
|
2236
|
+
return delay(2000);
|
|
2237
|
+
case 62:
|
|
2217
2238
|
retry();
|
|
2218
|
-
case
|
|
2239
|
+
case 63:
|
|
2219
2240
|
case "end":
|
|
2220
2241
|
return _context2.stop();
|
|
2221
2242
|
}
|
|
2222
|
-
}, _callee2, null, [[
|
|
2243
|
+
}, _callee2, null, [[13, 24], [31, 41]]);
|
|
2223
2244
|
}));
|
|
2224
2245
|
return _checkApprovalStatus.apply(this, arguments);
|
|
2225
2246
|
}
|
|
@@ -2741,7 +2762,7 @@ function useQueueManager(params) {
|
|
|
2741
2762
|
manager: manager,
|
|
2742
2763
|
notifier: params.notifier
|
|
2743
2764
|
});
|
|
2744
|
-
retryOn(params.lastConnectedWallet, params.notifier, manager);
|
|
2765
|
+
retryOn(params.lastConnectedWallet, params.notifier, manager, params.canSwitchNetworkTo);
|
|
2745
2766
|
}
|
|
2746
2767
|
}, [params.lastConnectedWallet]);
|
|
2747
2768
|
react.useEffect(function () {
|