VaultSpec

Documentation for eth_defi.vault.base.VaultSpec Python class.

class VaultSpec

Bases: object

Unique id for a vault.

  • Each vault can be identified by smart contract address by one of the contracts, related to its deployment. Usually this contract is vault contract itself.

  • We need both chain and address to specify vault we mean.

Attributes summary

chain_id

Ethereum chain id

vault_address

Vault smart contract address or whatever is the primary address for unravelling a vault deployment for a vault protocol.

Methods summary

__init__(chain_id, vault_address)

as_string_id()

parse_string(spec[, separator])

Parse vault spec from a string.

chain_id: int

Ethereum chain id

vault_address: Union[eth_typing.evm.HexAddress, str]

Vault smart contract address or whatever is the primary address for unravelling a vault deployment for a vault protocol.

Always forced to lowercase.

static parse_string(spec, separator='auto')

Parse vault spec from a string.

Parameters
  • spec (str) – String in the format of “chain_id,address” or “chain_id-address”

  • separator – Either “auto” or “-” or “,”

Returns

VaultSpec instance

Return type

eth_defi.vault.base.VaultSpec

__init__(chain_id, vault_address)
Parameters
Return type

None