Пример #1
0
        /// <summary>
        /// change password
        /// </summary>
        /// <param name="oldPassword"></param>
        /// <param name="newPassword"></param>
        /// <returns></returns>
        public static async Task <ApiResponse> WalletPassphraseChange(string oldPassword, string newPassword)
        {
            ApiResponse response = new ApiResponse();

            try
            {
                if (oldPassword == newPassword)
                {
                    throw new ApiCustomException(3000000, "The old password is not the same as the new password");
                }
                WalletManagement management = new WalletManagement();
                await management.WalletPassphraseChange(oldPassword, newPassword);
            }
            catch (ApiCustomException ex)
            {
                Logger.Singleton.Error(ex.Message);
                response.Error = new ApiError(ex.ErrorCode, ex.Message);
            }
            catch (Exception ex)
            {
                Logger.Singleton.Error(ex.Message);
                response.Error = new ApiError(ex.HResult, ex.Message);
            }
            return(response);
        }
Пример #2
0
 public async Task WalletPassphraseChange()
 {
     WalletManagement management = new WalletManagement();
     await management.WalletPassphraseChange("P@ssw0rd", "NewP@ssw0rd");
 }