@reservoir0x/relay-sdk
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
28 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentStepData = void 0;
const getCurrentStepData = (steps) => {
let currentStep = null;
let currentStepItem;
let txHashes = [];
for (const step of steps) {
for (const item of step.items || []) {
if (item.txHashes && item.txHashes.length > 0) {
txHashes = item.txHashes.concat([...txHashes]);
}
if (item.internalTxHashes && item.internalTxHashes.length > 0) {
txHashes = item.internalTxHashes.concat([...txHashes]);
}
if (item.status === 'incomplete') {
currentStep = step;
currentStepItem = item;
break;
}
}
if (currentStep && currentStepItem)
break;
}
return { currentStep, currentStepItem, txHashes };
};
exports.getCurrentStepData = getCurrentStepData;
//# sourceMappingURL=getCurrentStepData.js.map