DepositRequest
Documentation for eth_defi.vault.deposit_redeem.DepositRequest Python class.
- class DepositRequest
Bases:
objectWrap the different deposit functions async vaults implement.
Attributes summary
Vault we are dealing with
Owner of the shares
Receiver of underlying asset
Human-readable shares
Raw amount of shares
Transactions we need to perform in order to open a redemption
Set transaction gas limit
Attached ETH value to the tx
web3Methods 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
- 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
CannotParseRedemptionTransaction – If we did not know how to parse the transaction
VaultTransactionFailed – One of transactions reverted
- Parameters
tx_hashes (list[hexbytes.main.HexBytes]) –
- Return type
- 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
- __init__(vault, owner, to, amount, raw_amount, funcs, gas=None, value=None)
- Parameters
vault (VaultBase) –
owner (eth_typing.evm.HexAddress) –
to (eth_typing.evm.HexAddress) –
amount (decimal.Decimal) –
raw_amount (int) –
funcs (list[web3.contract.contract.ContractFunction]) –
gas (int | None) –
value (decimal.Decimal | None) –
- Return type
None