UNPKG

@lifi/sdk

Version:

LI.FI Any-to-Any Cross-Chain-Swap SDK

23 lines 894 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareRestart = void 0; const prepareRestart = (route) => { for (let index = 0; index < route.steps.length; index++) { const step = route.steps[index]; if (step.execution) { const lastValidIndex = step.execution.process.findLastIndex((process) => (!!process.txHash || !!process.taskId || !!process.signedTypedData?.length) && process.status !== 'FAILED'); if (lastValidIndex >= 0) { step.execution.process = step.execution.process.slice(0, lastValidIndex + 1); } else { step.execution.process = []; } } step.transactionRequest = undefined; } }; exports.prepareRestart = prepareRestart; //# sourceMappingURL=prepareRestart.js.map