@lifi/sdk
Advanced tools
Comparing version
@@ -34,8 +34,16 @@ "use strict"; | ||
// Make sure that the chain is still correct | ||
const updatedSigner = await (0, switchChain_1.switchChain)(signer, this.statusManager, step, this.settings.switchChainHook, this.allowUserInteraction); | ||
if (!updatedSigner) { | ||
// Chain switch was not successful, stop execution here | ||
return step; | ||
// Find if it's bridging and the step is waiting for a transaction on the receiving chain | ||
const recievingChainProcess = step.execution?.process.find((process) => process.type === 'RECEIVING_CHAIN'); | ||
// If the step is waiting for a transaction on the receiving chain, we do not switch the chain | ||
// All changes are already done from the source chain | ||
// Return the step | ||
if (recievingChainProcess?.substatus !== 'WAIT_DESTINATION_TRANSACTION' || | ||
!recievingChainProcess) { | ||
const updatedSigner = await (0, switchChain_1.switchChain)(signer, this.statusManager, step, this.settings.switchChainHook, this.allowUserInteraction); | ||
if (!updatedSigner) { | ||
// Chain switch was not successful, stop execution here | ||
return step; | ||
} | ||
signer = updatedSigner; | ||
} | ||
signer = updatedSigner; | ||
const parameters = { | ||
@@ -42,0 +50,0 @@ signer, |
export declare const name = "@lifi/sdk"; | ||
export declare const version = "2.0.0-beta.9"; | ||
export declare const version = "2.0.0-beta.10"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
exports.name = '@lifi/sdk'; | ||
exports.version = '2.0.0-beta.9'; | ||
exports.version = '2.0.0-beta.10'; |
@@ -31,8 +31,16 @@ import { StepExecutionManager } from './StepExecutionManager'; | ||
// Make sure that the chain is still correct | ||
const updatedSigner = await switchChain(signer, this.statusManager, step, this.settings.switchChainHook, this.allowUserInteraction); | ||
if (!updatedSigner) { | ||
// Chain switch was not successful, stop execution here | ||
return step; | ||
// Find if it's bridging and the step is waiting for a transaction on the receiving chain | ||
const recievingChainProcess = step.execution?.process.find((process) => process.type === 'RECEIVING_CHAIN'); | ||
// If the step is waiting for a transaction on the receiving chain, we do not switch the chain | ||
// All changes are already done from the source chain | ||
// Return the step | ||
if (recievingChainProcess?.substatus !== 'WAIT_DESTINATION_TRANSACTION' || | ||
!recievingChainProcess) { | ||
const updatedSigner = await switchChain(signer, this.statusManager, step, this.settings.switchChainHook, this.allowUserInteraction); | ||
if (!updatedSigner) { | ||
// Chain switch was not successful, stop execution here | ||
return step; | ||
} | ||
signer = updatedSigner; | ||
} | ||
signer = updatedSigner; | ||
const parameters = { | ||
@@ -39,0 +47,0 @@ signer, |
export declare const name = "@lifi/sdk"; | ||
export declare const version = "2.0.0-beta.9"; | ||
export declare const version = "2.0.0-beta.10"; |
export const name = '@lifi/sdk'; | ||
export const version = '2.0.0-beta.9'; | ||
export const version = '2.0.0-beta.10'; |
{ | ||
"name": "@lifi/sdk", | ||
"version": "2.0.0-beta.9", | ||
"version": "2.0.0-beta.10", | ||
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK", | ||
@@ -79,3 +79,3 @@ "main": "./dist/cjs/index.js", | ||
"@ethersproject/contracts": "^5.7.0", | ||
"@lifi/types": "^3.2.7", | ||
"@lifi/types": "^4.0.0", | ||
"bignumber.js": "^9.1.1", | ||
@@ -88,7 +88,8 @@ "eth-rpc-errors": "^4.0.3", | ||
"@commitlint/config-conventional": "^17.6.1", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"@mswjs/interceptors": "^0.22.12", | ||
"@typescript-eslint/eslint-plugin": "^5.59.1", | ||
"@typescript-eslint/parser": "^5.59.1", | ||
"@vitest/coverage-c8": "^0.30.1", | ||
"cross-fetch": "^3.1.5", | ||
"eslint": "^8.38.0", | ||
"eslint": "^8.39.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
@@ -101,5 +102,4 @@ "eslint-plugin-prettier": "^4.2.1", | ||
"pinst": "^3.0.0", | ||
"prettier": "^2.8.7", | ||
"prettier": "^2.8.8", | ||
"standard-version": "^9.5.0", | ||
"ts-loader": "^9.4.2", | ||
"typescript": "^5.0.4", | ||
@@ -106,0 +106,0 @@ "vitest": "^0.30.1" |
371545
0.33%8253
0.19%+ Added
- Removed
Updated