VeloraSwapResult

Documentation for eth_defi.velora.swap.VeloraSwapResult Python class.

class VeloraSwapResult

Bases: object

Result of a Velora swap execution.

Contains transaction hash and amounts from the executed swap.

Attributes summary

tx_hash

Transaction hash

buy_token

Token we received

sell_token

Token we sold

amount_sold

Amount of sell_token spent (raw units)

amount_bought

Amount of buy_token received (raw units)

Methods summary

__init__(tx_hash, buy_token, sell_token, ...)

get_amount_bought_decimal()

Get amount bought in human-readable decimals.

get_amount_sold_decimal()

Get amount sold in human-readable decimals.

tx_hash: hexbytes.main.HexBytes

Transaction hash

buy_token: eth_defi.token.TokenDetails

Token we received

sell_token: eth_defi.token.TokenDetails

Token we sold

amount_sold: int

Amount of sell_token spent (raw units)

amount_bought: int

Amount of buy_token received (raw units)

get_amount_sold_decimal()

Get amount sold in human-readable decimals.

Return type

decimal.Decimal

get_amount_bought_decimal()

Get amount bought in human-readable decimals.

Return type

decimal.Decimal

__init__(tx_hash, buy_token, sell_token, amount_sold, amount_bought)
Parameters
Return type

None