@lifi/sdk
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.1.1](https://github.com/lifinance/sdk/compare/v1.1.0...v1.1.1) (2022-08-03) | ||
### Bug Fixes | ||
* statusmanager reference issue ([#96](https://github.com/lifinance/sdk/issues/96)) ([0e4fe27](https://github.com/lifinance/sdk/commit/0e4fe27c58d4911347cd45163657aa3d8be9066e)) | ||
## [1.1.0](https://github.com/lifinance/sdk/compare/v1.0.2...v1.1.0) (2022-08-02) | ||
@@ -7,0 +14,0 @@ |
@@ -63,11 +63,11 @@ "use strict"; | ||
if (!allowanceProcess.txHash) return [3 /*break*/, 3]; | ||
statusManager.updateProcess(step, allowanceProcess.type, 'PENDING'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'PENDING'); | ||
return [4 /*yield*/, (0, getProvider_1.getProvider)(signer).waitForTransaction(allowanceProcess.txHash)]; | ||
case 2: | ||
_a.sent(); | ||
statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
return [3 /*break*/, 9]; | ||
case 3: | ||
if (!(allowanceProcess.status === 'DONE')) return [3 /*break*/, 4]; | ||
statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
return [3 /*break*/, 9]; | ||
@@ -90,3 +90,3 @@ case 4: return [4 /*yield*/, (0, utils_1.getApproved)(signer, token.address, spenderAddress)]; | ||
// update currentExecution | ||
statusManager.updateProcess(step, allowanceProcess.type, 'PENDING', { | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'PENDING', { | ||
txHash: approveTx.hash, | ||
@@ -100,6 +100,6 @@ txLink: chain.metamask.blockExplorerUrls[0] + 'tx/' + approveTx.hash, | ||
_a.sent(); | ||
statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
return [3 /*break*/, 9]; | ||
case 8: | ||
statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
_a.label = 9; | ||
@@ -117,3 +117,3 @@ case 9: return [3 /*break*/, 15]; | ||
error = _a.sent(); | ||
statusManager.updateProcess(step, allowanceProcess.type, 'FAILED', { | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'FAILED', { | ||
error: { | ||
@@ -140,3 +140,3 @@ message: error.message, | ||
_a.trys.push([0, 2, , 5]); | ||
statusManager.updateProcess(step, allowanceProcess.type, 'PENDING', { | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'PENDING', { | ||
txHash: replacementTx.hash, | ||
@@ -148,3 +148,3 @@ txLink: chain.metamask.blockExplorerUrls[0] + 'tx/' + replacementTx.hash, | ||
_a.sent(); | ||
statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
allowanceProcess = statusManager.updateProcess(step, allowanceProcess.type, 'DONE'); | ||
return [3 /*break*/, 5]; | ||
@@ -151,0 +151,0 @@ case 2: |
@@ -144,3 +144,3 @@ "use strict"; | ||
signer = updatedSigner; | ||
statusManager.updateProcess(step, crossChainProcess.type, 'ACTION_REQUIRED'); | ||
crossChainProcess = statusManager.updateProcess(step, crossChainProcess.type, 'ACTION_REQUIRED'); | ||
if (!this.shouldContinue) { | ||
@@ -155,3 +155,3 @@ return [2 /*return*/, step.execution]; | ||
// STEP 4: Wait for Transaction /////////////////////////////////////////// | ||
statusManager.updateProcess(step, crossChainProcess.type, 'PENDING', { | ||
crossChainProcess = statusManager.updateProcess(step, crossChainProcess.type, 'PENDING', { | ||
txHash: tx.hash, | ||
@@ -168,3 +168,3 @@ txLink: fromChain.metamask.blockExplorerUrls[0] + 'tx/' + tx.hash, | ||
if (!(e_1.code === 'TRANSACTION_REPLACED' && e_1.replacement)) return [3 /*break*/, 17]; | ||
statusManager.updateProcess(step, crossChainProcess.type, 'PENDING', { | ||
crossChainProcess = statusManager.updateProcess(step, crossChainProcess.type, 'PENDING', { | ||
txHash: e_1.replacement.hash, | ||
@@ -179,3 +179,3 @@ txLink: fromChain.metamask.blockExplorerUrls[0] + | ||
error = _g.sent(); | ||
statusManager.updateProcess(step, crossChainProcess.type, 'FAILED', { | ||
crossChainProcess = statusManager.updateProcess(step, crossChainProcess.type, 'FAILED', { | ||
error: { | ||
@@ -191,3 +191,3 @@ message: error.message, | ||
case 20: | ||
statusManager.updateProcess(step, crossChainProcess.type, 'DONE'); | ||
crossChainProcess = statusManager.updateProcess(step, crossChainProcess.type, 'DONE'); | ||
receivingChainProcess = statusManager.findOrCreateProcess('RECEIVING_CHAIN', step, 'PENDING'); | ||
@@ -206,3 +206,3 @@ _g.label = 21; | ||
e_2 = _g.sent(); | ||
statusManager.updateProcess(step, receivingChainProcess.type, 'FAILED', { | ||
receivingChainProcess = statusManager.updateProcess(step, receivingChainProcess.type, 'FAILED', { | ||
error: { | ||
@@ -217,3 +217,3 @@ code: errors_1.LifiErrorCode.TransactionFailed, | ||
case 24: | ||
statusManager.updateProcess(step, receivingChainProcess.type, 'DONE', { | ||
receivingChainProcess = statusManager.updateProcess(step, receivingChainProcess.type, 'DONE', { | ||
substatus: statusResponse.substatus, | ||
@@ -220,0 +220,0 @@ substatusMessage: statusResponse.substatusMessage || |
@@ -136,3 +136,3 @@ "use strict"; | ||
// -> set step.execution | ||
statusManager.updateProcess(step, swapProcess.type, 'ACTION_REQUIRED'); | ||
swapProcess = swapProcess = statusManager.updateProcess(step, swapProcess.type, 'ACTION_REQUIRED'); | ||
if (!this.shouldContinue) { | ||
@@ -152,3 +152,3 @@ return [2 /*return*/, step.execution]; // stop before user interaction is needed | ||
error = _g.sent(); | ||
statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
error: { | ||
@@ -164,3 +164,3 @@ message: error.message, | ||
// Wait for Transaction | ||
statusManager.updateProcess(step, swapProcess.type, 'PENDING', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'PENDING', { | ||
txLink: fromChain.metamask.blockExplorerUrls[0] + 'tx/' + tx.hash, | ||
@@ -180,3 +180,3 @@ txHash: tx.hash, | ||
receipt = e_2.replacement; | ||
statusManager.updateProcess(step, swapProcess.type, 'PENDING', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'PENDING', { | ||
txHash: e_2.replacement.hash, | ||
@@ -191,3 +191,3 @@ txLink: fromChain.metamask.blockExplorerUrls[0] + | ||
error = _g.sent(); | ||
statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
error: { | ||
@@ -213,3 +213,3 @@ message: error.message, | ||
e_3 = _g.sent(); | ||
statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'FAILED', { | ||
error: { | ||
@@ -224,3 +224,3 @@ code: errors_1.LifiErrorCode.TransactionFailed, | ||
case 26: | ||
statusManager.updateProcess(step, swapProcess.type, 'DONE', { | ||
swapProcess = statusManager.updateProcess(step, swapProcess.type, 'DONE', { | ||
txHash: (_c = statusResponse.receiving) === null || _c === void 0 ? void 0 : _c.txHash, | ||
@@ -227,0 +227,0 @@ txLink: fromChain.metamask.blockExplorerUrls[0] + |
@@ -85,3 +85,3 @@ "use strict"; | ||
} | ||
statusManager.updateProcess(step, switchProcess.type, 'DONE'); | ||
switchProcess = statusManager.updateProcess(step, switchProcess.type, 'DONE'); | ||
statusManager.updateExecution(step, 'PENDING'); | ||
@@ -91,3 +91,3 @@ return [2 /*return*/, updatedSigner]; | ||
error_1 = _b.sent(); | ||
statusManager.updateProcess(step, switchProcess.type, 'FAILED', { | ||
switchProcess = statusManager.updateProcess(step, switchProcess.type, 'FAILED', { | ||
error: { | ||
@@ -94,0 +94,0 @@ message: error_1.message, |
{ | ||
"name": "@lifi/sdk", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
306479