use of eu.cryptoeuro.accountmapper.domain.EthereumAccount in project account-identity by cryptofiat.
the class AccountManagementService method storeNewAccount.
public EthereumAccount storeNewAccount(String address, String ownerId, AuthorisationType authorisationType) {
address = ethService.without0x(address);
try {
validateAccountStoring(address, ownerId);
EthereumAccount account = EthereumAccount.builder().ownerId(ownerId).address(address).activated(false).authorisationType(authorisationType).build();
ethereumAccountRepository.save(account);
return account;
} catch (CannotStoreAccountException e) {
throw e;
} catch (Exception e) {
throw new CannotStoreAccountException("Crashed while storing new account", e.getCause());
}
}
Aggregations