CrossChainSwap

Documentation for eth_defi.lifi.crosschain.CrossChainSwap Python class.

class CrossChainSwap

Bases: object

A prepared cross-chain gas top-up swap.

Contains all information needed to execute a bridge transaction from the source chain to a target chain.

Attributes summary

source_chain_id

target_chain_id

from_amount_raw

from_amount_usd

target_balance_usd

min_gas_usd

top_up_usd

transaction_request

quote

Methods summary

__init__(source_chain_id, target_chain_id, ...)

is_valid([max_age_seconds])

Check if the underlying quote is still fresh enough to execute.

__init__(source_chain_id, target_chain_id, from_amount_raw, from_amount_usd, target_balance_usd, min_gas_usd, top_up_usd, transaction_request, quote)
Parameters
Return type

None

is_valid(max_age_seconds=120)

Check if the underlying quote is still fresh enough to execute.

Delegates to is_valid().

Parameters

max_age_seconds (float) – Maximum acceptable age in seconds (default 120s)

Return type

bool