Skip to content

Commit 18a5a1d

Browse files
committed
feat: add SafeAccount.propose as a shortcut to propose to Safe API
1 parent b316bc4 commit 18a5a1d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

ape_safe/accounts.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def propose_safe_tx(
399399
contractTransactionHash: Optional[SafeTxID] = None,
400400
) -> SafeTxID:
401401
"""
402-
Propose a transaction to the Safe API client
402+
Propose a safe_tx to the Safe API client
403403
"""
404404
if not contractTransactionHash:
405405
contractTransactionHash = get_safe_tx_hash(safe_tx)
@@ -429,6 +429,18 @@ def propose_safe_tx(
429429

430430
return contractTransactionHash
431431

432+
def propose(
433+
self,
434+
txn: Optional[TransactionAPI] = None,
435+
submitter: Union[AccountAPI, AddressType, str, None] = None,
436+
**safe_tx_kwargs,
437+
) -> SafeTxID:
438+
"""
439+
Propose a transaction to the Safe API client
440+
"""
441+
safe_tx = self.create_safe_tx(txn=txn, **safe_tx_kwargs)
442+
return self.propose_safe_tx(safe_tx, submitter=submitter)
443+
432444
def pending_transactions(self) -> Iterator[tuple[SafeTx, list[SafeTxConfirmation]]]:
433445
for executed_tx in self.client.get_transactions(confirmed=False):
434446
yield self.create_safe_tx(

0 commit comments

Comments
 (0)