Skip to content
docs

LifiProviderConfig

Defined in: protocol-swap2-lifi/src/provider.ts:171

Explicit constructor configuration; no deployment environment is read.

optional allowInsecureApiUrl?: boolean

Defined in: protocol-swap2-lifi/src/provider.ts:179

Allow an http: apiUrl (local development only): the quotes and the Diamond calldata travel it, and over plain http anyone on the path rewrites them (scan 2026-10-27 modules, F20).


optional apiKey?: string

Defined in: protocol-swap2-lifi/src/provider.ts:180


optional apiUrl?: string

Defined in: protocol-swap2-lifi/src/provider.ts:174

LI.FI REST base URL. Explicitly injectable for proxies and tests; must be https unless allowInsecureApiUrl.


optional chooseRoute?: (routes, params) => LifiRouteChoice | null | undefined

Defined in: protocol-swap2-lifi/src/provider.ts:204

Route policy hook. When set, a cross-chain quote first asks LI.FI’s /advanced/routes for the candidates, hands them to this function and restricts /quote to what it returns (allowBridges / denyBridges / order). Returning null/undefined, or any failure of the routes call, leaves LI.FI’s default pick. The policy itself (tie band, max ETA, deny list) belongs to the app; the module only carries the choice.

readonly LifiRouteOption[]

QuoteParams

LifiRouteChoice | null | undefined


optional defaultSlippageBps?: number

Defined in: protocol-swap2-lifi/src/provider.ts:195

Slippage sent when the caller names none (bps, default 50 = LI.FI’s own documented default). Left unset, LI.FI picks it per request and it swings (0.9%–6% within a minute on Base ETH → Robinhood, 2026-10-12): the display quote’s minimum then sits above the live one and the execution floor refuses a route that hasn’t moved.


optional enabled?: boolean

Defined in: protocol-swap2-lifi/src/provider.ts:172


optional integrator?: string

Defined in: protocol-swap2-lifi/src/provider.ts:181


optional quoteTtlMs?: number

Defined in: protocol-swap2-lifi/src/provider.ts:187

Fail-closed local lifetime for the provider’s documented ~60s quote window.


optional trustedApprovalAddresses?: Readonly<Record<string, readonly string[]>>

Defined in: protocol-swap2-lifi/src/provider.ts:185

Additional audited ERC-20 spenders returned by LI.FI for direct routes.


optional trustedTransactionTargets?: Readonly<Record<string, readonly string[]>>

Defined in: protocol-swap2-lifi/src/provider.ts:183

Additional audited LI.FI entry points for networks whose Diamond differs.