[docs]classSimpleKeyring(BaseModel):account:EcdsaAccount=Field(default=None)network:str=Field(default=NetworkId.Constellation.value)# Serialize all accounts
[docs]defadd_account_at(self,index:int):"""Not supported for SimpleKeyring"""raiseNotImplementedError("SimpleKeyring :: Accounts can't be added to SimpleKeyrings.")
[docs]defget_accounts(self)->List[Union[DagAccount,EthAccount,Any]]:""" Get all accounts in the simple keyring. :return: List of account classes (only one). """return[self.account]
[docs]defget_account_by_address(self,address:str):""" Get the account matching the specified address. :return: Account class or None is nothing matches. """returnself.accountifaddress==self.account.get_address()elseNone
[docs]defremove_account(self,account):"""Not supported for SimpleKeyring"""raiseNotImplementedError("SimpleKeyring :: Removal of SimpleKeyring accounts isn't supported.")