erc_4626.vault_protocol.royco.offchain_metadata
Documentation for eth_defi.erc_4626.vault_protocol.royco.offchain_metadata Python module.
Royco offchain vault metadata.
Royco exposes two first-party API surfaces that can contain vault-like rows:
POST /api/v1/market/explorefor Incentivised Action Market vault wrappersPOST /api/v1/vault/explorefor Royco Vault product rows
Both endpoints are authenticated with x-api-key. Royco documents
ROYCO_DEMO as the public demo key.
Relevant documentation:
Functions
|
Fetch Royco metadata for a vault address. |
|
Fetch and cache Royco offchain vault metadata. |
Classes
Royco offchain vault metadata. |
- class RoycoOffchainVaultMetadata
Bases:
TypedDictRoyco offchain vault metadata.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- fetch_royco_vault_metadata(web3, vault_address)
Fetch Royco metadata for a vault address.
- Parameters
web3 (web3.main.Web3) – Web3 instance, used for checksum normalisation.
vault_address (eth_typing.evm.HexAddress) – Vault contract address.
- Returns
Royco metadata dict or
Noneif the vault is not in Royco’s API.- Return type
Optional[eth_defi.erc_4626.vault_protocol.royco.offchain_metadata.RoycoOffchainVaultMetadata]
- fetch_royco_vaults(cache_path=PosixPath('/home/runner/.tradingstrategy/cache/royco'), api_base_url='https://api.royco.org/api/v1', api_key=None, now_=None, max_cache_duration=datetime.timedelta(days=2))
Fetch and cache Royco offchain vault metadata.
- Parameters
cache_path (pathlib.Path) – Directory for cache files.
api_base_url (str) – Royco API base URL.
api_key (Optional[str]) – Royco API key. Defaults to
ROYCO_API_KEYorROYCO_DEMO.now – Override current time for tests.
max_cache_duration (datetime.timedelta) – How long before refreshing cache.
now_ (Optional[datetime.datetime]) –
- Returns
Metadata mapped by checksummed vault address.
- Return type
dict[eth_typing.evm.HexAddress, eth_defi.erc_4626.vault_protocol.royco.offchain_metadata.RoycoOffchainVaultMetadata]