Skip to content

Commit

Permalink
Add signTransaction in decorateWallet()
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv committed Oct 1, 2024
1 parent 2676f27 commit 55623df
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export class WalletModules {
const _signIn = wallet.signIn;
const _signOut = wallet.signOut;
const _signMessage = wallet.signMessage;
const _signTransaction = wallet.signTransaction;

wallet.signIn = async (params: never) => {
const accounts = await _signIn(params);
Expand Down Expand Up @@ -332,6 +333,16 @@ export class WalletModules {
return await _signMessage(params);
};

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

return await _signTransaction(params);
};

return wallet;
}

Expand Down

0 comments on commit 55623df

Please sign in to comment.