Skip to content

@lelantos-org/sdk / services / fetchSwapQuote

Function: fetchSwapQuote() ​

ts
function fetchSwapQuote(
   baseUrl, 
   req, 
   opts?
): Promise<SwapRouteQuote>;

Defined in: @lelantos-org/sdk/dist/services/quoter/client.d.ts:68

Fetch the best route from MetaQuoter. baseUrl is the root the service is mounted on (no trailing /v1/quotes).

Throws NetworkError (QUOTER_TIMEOUT / QUOTER_FAILED) on transport failure and WireFormatError on a response that is not a SwapRouteQuote; both are WalletErrors, so isWalletError recognises them.

Parameters ​

ParameterType
baseUrlstring
reqSwapQuoteRequest
opts?FetchSwapQuoteOptions

Returns ​

Promise<SwapRouteQuote>