Skip to main content

Crate wp_evm_lifi

Crate wp_evm_lifi 

Source
Expand description

LiFi aggregator protocol facade.

Thin wrapper that hits the LiFi API (https://li.quest/v1/quote) and converts the response into an AggregatorQuote for consumption by the aggregator family’s plan::execute_quote.

§Authentication

LiFi’s API can be called without authentication (rate-limited) or with an API key passed via the x-lifi-api-key header. fetch_quote accepts api_key: Option<&str> so the facade works in both modes.

§Scope

  • Multi-chain same-chain swaps (fromChain == toChain == request.chain_id); cross-chain bridging deferred.
  • Exact-in only (fromAmount) — exact-out not supported by LiFi’s quote endpoint

Structs§

AggregatorQuote
A quote fetched from an aggregator API.
AggregatorRequest
Parameters for an aggregator quote request.
PlanFragment
Output of a plan function: a bundle of calls + declared approvals + value.

Enums§

AggregatorError
Aggregator family error type. Facades may wrap their protocol- specific errors in AggregatorError::Protocol(String) for uniform handling.

Constants§

API_BASE_URL
LiFi Quote API base URL.
CHAIN_ID_ETHEREUM
Ethereum mainnet chain ID.
LIFI_DIAMOND
Canonical LiFi Diamond contract on Ethereum mainnet.

Functions§

fetch_quote
plan_swap