public IActionResult GetSessionInfo(long spId) { string nonce = ConfidentialAssetsHelper.GetRandomSeed().ToHexString(); AccountDescriptor spAccount = _accountsService.GetById(spId); return(Ok(new { publicKey = spAccount.PublicSpendKey.ToHexString(), sessionKey = nonce, })); }
public IActionResult Register([FromBody] AccountDto accountDto) { try { long accountId = _accountsService.Create((AccountType)accountDto.AccountType, accountDto.AccountInfo, accountDto.Password); var accountDescriptor = _accountsService.GetById(accountId); return(Ok(_translatorsRepository.GetInstance <AccountDescriptor, AccountDto>().Translate(accountDescriptor))); } catch (Exception ex) { return(BadRequest(new { ex.Message })); } }
public IActionResult GetById(long accountId) { AccountDescriptor account = _accountsService.GetById(accountId); if (account == null) { return(BadRequest()); } var identityProvider = new IdentityProviderInfoDto { Id = account.AccountId.ToString(CultureInfo.InvariantCulture), Description = account.AccountInfo, Target = account.PublicSpendKey.ToHexString() }; return(Ok(identityProvider)); }