From 1b55e8c49f8c985e63625012e6cb1308beaa182c Mon Sep 17 00:00:00 2001 From: Nishaad Date: Sat, 21 Feb 2026 01:04:03 -0500 Subject: [PATCH] feat: add manual route override option after quote fetch Allow users to manually configure routes even when quote service returns successfully. After fetching a quote, users are now shown quote details (route amount, deadline, fees) and prompted to either use the quote or proceed with manual configuration. Co-Authored-By: Claude Sonnet 4.5 --- src/commands/publish.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/commands/publish.ts b/src/commands/publish.ts index 91b49db..0078a42 100644 --- a/src/commands/publish.ts +++ b/src/commands/publish.ts @@ -298,6 +298,42 @@ async function buildIntentInteractively(options: PublishCommandOptions) { logger.warning('Quote response missing required contract addresses'); quote = null; } + + // If quote is valid, ask user if they want to use it or configure manually + if (quote) { + const quoteData = quote.quoteResponse; + if (quoteData) { + logger.log(''); + logger.log('📊 Quote Details:'); + logger.log( + ` Route Amount: ${formatUnits(BigInt(quoteData.destinationAmount), routeToken.decimals)} ${routeToken.symbol || ''}` + ); + logger.log(` Deadline: ${new Date(quoteData.deadline * 1000).toLocaleString()}`); + if (quoteData.estimatedFulfillTimeSec) { + logger.log(` Estimated Fulfillment: ${quoteData.estimatedFulfillTimeSec} seconds`); + } + if (quoteData.fees && quoteData.fees.length > 0) { + logger.log( + ` Fees: ${quoteData.fees.map(f => `${formatUnits(BigInt(f.amount), f.token.decimals)} ${f.token.symbol}`).join(', ')}` + ); + } + logger.log(''); + + const { useQuote } = await inquirer.prompt([ + { + type: 'confirm', + name: 'useQuote', + message: 'Use this quote or configure route manually?', + default: true, + }, + ]); + + if (!useQuote) { + logger.log('Proceeding with manual configuration...'); + quote = null; + } + } + } } catch (error: any) { logger.stopSpinner(); if (process.env.DEBUG) {