DepositRequest

Documentation for eth_defi.vault.deposit_redeem.DepositRequest Python class.

class DepositRequest

Bases: object

Wrap the different deposit functions async vaults implement.

Attributes summary

vault

Vault we are dealing with

owner

Owner of the shares

to

Receiver of underlying asset

amount

Human-readable shares

raw_amount

Raw amount of shares

funcs

Transactions we need to perform in order to open a redemption

gas

Set transaction gas limit

value

Attached ETH value to the tx

web3

Methods summary

__init__(vault, owner, to, amount, ...[, ...])

broadcast([from_, gas, check_value])

Broadcast all the transactions in this request.

parse_deposit_transaction(tx_hashes)

Parse the transaction receipt to get the actual shares redeemed.

vault: VaultBase

Vault we are dealing with

owner: eth_typing.evm.HexAddress

Owner of the shares

to: eth_typing.evm.HexAddress

Receiver of underlying asset

amount: decimal.Decimal

Human-readable shares

raw_amount: int

Raw amount of shares

funcs: list[web3.contract.contract.ContractFunction]

Transactions we need to perform in order to open a redemption

It’s a list because for Gains we need 2 tx

gas: int | None

Set transaction gas limit

value: decimal.Decimal | None

Attached ETH value to the tx

parse_deposit_transaction(tx_hashes)

Parse the transaction receipt to get the actual shares redeemed.

  • Assumes only one redemption request per vault per transaction

  • Most throw an

Raises
Parameters

tx_hashes (list[hexbytes.main.HexBytes]) –

Return type

eth_defi.vault.deposit_redeem.DepositTicket

broadcast(from_=None, gas=None, check_value=True)

Broadcast all the transactions in this request.

Parameters
  • from – Address to send the transactions from

  • gas (int | None) – Gas limit to use for each transaction

  • from_ (eth_typing.evm.HexAddress) –

Returns

List of transaction hashes

Raises

TransactionAssertionError – If any of the transactions revert

Return type

eth_defi.vault.deposit_redeem.RedemptionTicket

__init__(vault, owner, to, amount, raw_amount, funcs, gas=None, value=None)
Parameters
Return type

None