Skip to content

Commit

Permalink
Refactor signTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv committed Oct 2, 2024
1 parent 55623df commit 7465b61
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,20 @@ export class WalletModules {

wallet.signTransaction = async (params: never) => {
if (_signTransaction === undefined) {
throw Error(
throw new Error(
`The signTransaction method is not supported by ${wallet.metadata.name}`
);
}

return await _signTransaction(params);
try {
return await _signTransaction(params);
} catch (error) {
throw new Error(
`Failed to sign transaction: ${
error instanceof Error ? error.message : String(error)
}`
);
}
};

return wallet;
Expand Down

0 comments on commit 7465b61

Please sign in to comment.