RedemptionRequest
Documentation for eth_defi.vault.deposit_redeem.RedemptionRequest Python class.
- class RedemptionRequest
Bases:
objectWrap the different redeem 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
web3Methods summary
__init__(vault, owner, to, shares, ...)broadcast([from_, gas])Broadcast all the transactions in this request.
parse_redeem_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
- shares: decimal.Decimal
Human-readable shares
- raw_shares: 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
- parse_redeem_transaction(tx_hashes)
Parse the transaction receipt to get the actual shares redeemed.
Assumes only one redemption request per vault per transaction
- Raises
CannotParseRedemptionTransaction – If we did not know how to parse the transaction
- Parameters
tx_hashes (list[hexbytes.main.HexBytes]) –
- Return type
- broadcast(from_=None, gas=1000000)
Broadcast all the transactions in this request.
- Parameters
from – Address to send the transactions from
gas (int) – Gas limit to use for each transaction
from_ (eth_typing.evm.HexAddress) –
- Returns
List of transaction hashes
- Return type
list[hexbytes.main.HexBytes]
- __init__(vault, owner, to, shares, raw_shares, funcs)
- Parameters
vault (VaultBase) –
owner (eth_typing.evm.HexAddress) –
to (eth_typing.evm.HexAddress) –
shares (decimal.Decimal) –
raw_shares (int) –
funcs (list[web3.contract.contract.ContractFunction]) –
- Return type
None