@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
| Parameter | Type |
|---|---|
baseUrl | string |
req | SwapQuoteRequest |
opts? | FetchSwapQuoteOptions |
Returns
Promise<SwapRouteQuote>