Skip to content

Commit

Permalink
feat: add SafeAccount.propose as a shortcut to propose to Safe API
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Jun 6, 2024
1 parent 3710d25 commit 9aa25ab
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ape_safe/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def propose_safe_tx(
contractTransactionHash: Optional[SafeTxID] = None,
) -> SafeTxID:
"""
Propose a transaction to the Safe API client
Propose a safe_tx to the Safe API client
"""
if not contractTransactionHash:
contractTransactionHash = get_safe_tx_hash(safe_tx)
Expand Down Expand Up @@ -415,6 +415,18 @@ def propose_safe_tx(

return contractTransactionHash

def propose(
self,
txn: Optional[TransactionAPI] = None,
submitter: Union[AccountAPI, AddressType, str, None] = None,
**safe_tx_kwargs,
) -> SafeTxID:
"""
Propose a transaction to the Safe API client
"""
safe_tx = self.create_safe_tx(txn=txn, **safe_tx_kwargs)
return self.propose_safe_tx(safe_tx, submitter=submitter)

def pending_transactions(self) -> Iterator[tuple[SafeTx, list[SafeTxConfirmation]]]:
for executed_tx in self.client.get_transactions(confirmed=False):
yield self.create_safe_tx(
Expand Down

0 comments on commit 9aa25ab

Please sign in to comment.