TradeFail

Documentation for eth_defi.trade.TradeFail Python class.

class TradeFail

Bases: eth_defi.trade.TradeResult

Describe the result of a failed Uniswap swap.

The transaction reverted for a reason or another.

Attributes summary

revert_reason

Revert reason if we managed to extract one

Methods summary

__init__(gas_used, effective_gas_price[, ...])

get_cost_of_gas()

This will return the gas cost of the transaction in blockchain's native currency e.g.

get_effective_gas_price_gwei()

revert_reason: Optional[str] = None

Revert reason if we managed to extract one

__init__(gas_used, effective_gas_price, revert_reason=None)
Parameters
Return type

None

get_cost_of_gas()

This will return the gas cost of the transaction in blockchain’s native currency e.g. in ETH on Ethereum.

Return type

decimal.Decimal