From d62591aa346f71c564219575edf6578b64a7213d Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Tue, 3 Dec 2024 12:40:41 +0100 Subject: [PATCH] fix: handle blocked staking rewards error for hardware wallets [LW-11931] Signed-off-by: Dominik Guzei --- source/renderer/app/api/api.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/renderer/app/api/api.ts b/source/renderer/app/api/api.ts index bc1b38c31f..e1fd61baba 100644 --- a/source/renderer/app/api/api.ts +++ b/source/renderer/app/api/api.ts @@ -1318,7 +1318,13 @@ export default class AdaApi { logger.error('AdaApi::createExternalTransaction error', { error, }); - throw new ApiError(error).result(); + + const apiError = new ApiError(error) + .set('conwayWalletNotDelegatedToDRep') + .where('code', 'created_invalid_transaction') + .inc('message', 'ConwayWdrlNotDelegatedToDRep'); + + throw apiError.result(); } }; inspectAddress = async (request: {