From 5b7212502e90a1ed5d088f2576c5b640ec475cd0 Mon Sep 17 00:00:00 2001 From: techdigger <72038289+techdigger@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:49:43 +0000 Subject: [PATCH] Sign approve_hash with hardware wallets approve_hash calls sender_account.sign_transaction, which only local accounts have. With a Ledger or Trezor sender the call fails, so hardware wallet owners cannot approve a Safe transaction hash on chain. Use the hardware wallet's get_signed_raw_transaction when the sender has it. --- src/safe_cli/operators/safe_operator.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/safe_cli/operators/safe_operator.py b/src/safe_cli/operators/safe_operator.py index 0c94779b..f88c5b1c 100644 --- a/src/safe_cli/operators/safe_operator.py +++ b/src/safe_cli/operators/safe_operator.py @@ -460,10 +460,15 @@ def approve_hash(self, hash_to_approve: HexBytes, sender: str) -> bool: if call_result: # There's revert message return False else: - signed_transaction = sender_account.sign_transaction(transaction_to_send) - tx_hash = self.ethereum_client.send_raw_transaction( - signed_transaction["raw_transaction"] - ) + if hasattr(sender_account, "get_signed_raw_transaction"): # Ledger, Trezor + raw_transaction = sender_account.get_signed_raw_transaction( + transaction_to_send, self.ethereum_client.get_chain_id() + ) + else: + raw_transaction = sender_account.sign_transaction(transaction_to_send)[ + "raw_transaction" + ] + tx_hash = self.ethereum_client.send_raw_transaction(raw_transaction) print_formatted_text( HTML( f"Sent tx with tx-hash {to_0x_hex_str(tx_hash)} from owner "