vault.flow_events
Documentation for eth_defi.vault.flow_events Python module.
Asynchronous vault request event discovery helpers.
Functions
|
Create a pending vault flow from common indexed log metadata. |
|
Decode a hex integer field returned by Hypersync. |
|
Decode an indexed address topic. |
|
Decode an indexed unsigned integer topic. |
Decode a single non-indexed |
|
|
Convert ABI event data to bytes. |
|
Fetch raw vault request logs with Hypersync. |
|
Normalise an event topic to a lower-case |
Classes
Raw indexed log data returned by Hypersync for vault flow discovery. |
|
An indexed asynchronous vault request event. |
|
Direction of an asynchronous vault flow. |
- class IndexedVaultFlowLog
Bases:
objectRaw indexed log data returned by Hypersync for vault flow discovery.
- __init__(address, topics, data, block_number, block_timestamp, transaction_hash, log_index)
- Parameters
address (eth_typing.evm.HexAddress) –
data (str) –
block_number (int) –
block_timestamp (Optional[datetime.datetime]) –
transaction_hash (str) –
log_index (int) –
- Return type
None
- class PendingVaultFlow
Bases:
objectAn indexed asynchronous vault request event.
This object is the protocol-neutral bridge between event discovery and higher-level accounting recovery. It intentionally carries both the raw request facts and a serialised ticket payload that can be fed back to the protocol-specific vault ticket reconstruction path.
- Parameters
chain_id – EVM chain id where the event was emitted.
vault_address – Vault contract that emitted the request event.
owner – Economic owner of the request.
controller – ERC-7540 controller address where applicable. Protocols without a separate controller use the owner address.
direction – Deposit or redemption request.
status – Status implied by the event. Request events are emitted before settlement, so this is normally
pending; callers can query the current status with the reconstructed ticket.request_id – Protocol request id, if any.
settlement_id – Protocol settlement id, if any.
raw_assets – Raw denomination token amount for deposits, when known.
raw_shares – Raw vault share amount for redemptions, when known.
request_tx_hash – Transaction hash that emitted the request event.
request_block_number – Block number that emitted the request event.
request_block_timestamp – Naive UTC timestamp for the request block, when provided by the event backend.
log_index – Log index for stable event identity.
ticket_data – Serialised protocol ticket data compatible with the manager’s
reconstruct_*_ticket()methods.
- __init__(chain_id, vault_address, owner, controller, direction, status, request_id, settlement_id, raw_assets, raw_shares, request_tx_hash, request_block_number, request_block_timestamp, log_index, ticket_data)
- Parameters
chain_id (int) –
vault_address (eth_typing.evm.HexAddress) –
owner (eth_typing.evm.HexAddress) –
controller (Optional[eth_typing.evm.HexAddress]) –
direction (eth_defi.vault.flow_events.VaultFlowDirection) –
status (enum.Enum) –
request_tx_hash (str) –
request_block_number (int) –
request_block_timestamp (Optional[datetime.datetime]) –
log_index (int) –
ticket_data (dict) –
- Return type
None
- create_pending_vault_flow(*, chain_id, vault_address, owner, controller, direction, status, log, ticket_data, request_id=None, settlement_id=None, raw_assets=None, raw_shares=None)
Create a pending vault flow from common indexed log metadata.
- Parameters
chain_id (int) –
vault_address (eth_typing.evm.HexAddress) –
owner (eth_typing.evm.HexAddress) –
controller (Optional[eth_typing.evm.HexAddress]) –
direction (eth_defi.vault.flow_events.VaultFlowDirection) –
status (enum.Enum) –
ticket_data (dict) –
- Return type
- decode_hypersync_int(value)
Decode a hex integer field returned by Hypersync.
- decode_indexed_event_address(topic)
Decode an indexed address topic.
- decode_indexed_event_uint(topic)
Decode an indexed unsigned integer topic.
- decode_single_uint256_event_data(data)
Decode a single non-indexed
uint256event argument.
- event_data_to_bytes(data)
Convert ABI event data to bytes.
- fetch_vault_flow_logs_hypersync(*, hypersync_client, vault_address, topic0_list, start_block, end_block)
Fetch raw vault request logs with Hypersync.
This synchronous wrapper keeps vault manager APIs threaded and blocking, matching the rest of the vault manager interface.
- Parameters
hypersync_client – Configured Hypersync client for the vault chain.
vault_address (eth_typing.evm.HexAddress) – Vault contract address to scan.
topic0_list (list[str]) – Event signature topics to include.
start_block (int) – Inclusive start block.
end_block (int) – Inclusive end block.
- Returns
Raw logs sorted by
(block_number, log_index).- Return type