gnosis/safe/safe_tx.py
def execute(
        self,
        tx_sender_private_key: str,
        tx_gas: Optional[int] = None,
        tx_gas_price: Optional[int] = None,
        tx_nonce: Optional[int] = None,
        block_identifier: Optional[BlockIdentifier] = "latest",
        eip1559_speed: Optional[TxSpeed] = None,
    ) -> Tuple[HexBytes, TxParams]:
        """
        Send multisig tx to the Safe

        :param tx_sender_private_key: Sender private key
        :param tx_gas: Gas for the external tx. If not, `(safe_tx_gas + base_gas) * 2` will be used
        :param tx_gas_price: Gas price of the external tx. If not, `gas_price` will be used
        :param tx_nonce: Force nonce for `tx_sender`
        :param block_identifier: `latest` or `pending`
        :param eip1559_speed: If provided, use EIP1559 transaction
        :return: Tuple(tx_hash, tx)
        :raises: InvalidMultisigTx: If user tx cannot go through the Safe
        """

        sender_account = Account.from_key(tx_sender_private_key)
        if eip1559_speed and self.ethereum_client.is_eip1559_supported():
            tx_parameters = self.ethereum_client.set_eip1559_fees(
                {
                    "from": sender_account.address,
                },
                tx_speed=eip1559_speed,
            )
        else:
            tx_parameters = {
                "from": sender_account.address,
                "gasPrice": tx_gas_price or self.gas_price or self.w3.eth.gas_price,
            }

        if tx_gas:
            tx_parameters["gas"] = tx_gas
        if tx_nonce is not None:
            tx_parameters["nonce"] = tx_nonce

        self.tx = self.w3_tx.buildTransaction(tx_parameters)
        self.tx["gas"] = Wei(
            tx_gas or (max(self.tx["gas"] + 75000, self.recommended_gas()))
        )

        self.tx_hash = self.ethereum_client.send_unsigned_transaction(
            self.tx,
            private_key=sender_account.key,
            retry=False if tx_nonce is not None else True,
            block_identifier=block_identifier,
        )

        # Set signatures empty after executing the tx. `Nonce` is increased even if it fails,
        # so signatures are not valid anymore
        self.signatures = b""
        return self.tx_hash, self.tx

        Send multisig tx to the Safe

        :param tx_sender_private_key: Sender private key
        :param tx_gas: Gas for the external tx. If not, `(safe_tx_gas + base_gas) * 2` will be used
        :param tx_gas_price: Gas price of the external tx. If not, `gas_price` will be used
        :param tx_nonce: Force nonce for `tx_sender`
        :param block_identifier: `latest` or `pending`
        :param eip1559_speed: If provided, use EIP1559 transaction
        :return: Tuple(tx_hash, tx)
        :raises: InvalidMultisigTx: If user tx cannot go through the Safe
        
Send multisig tx to the Safe
Send multisig tx to the Safe
def execute(
        self,
        tx_sender_private_key: str,
        tx_gas: Optional[int] = None,
        tx_gas_price: Optional[int] = None,
        tx_nonce: Optional[int] = None,
        block_identifier: Optional[BlockIdentifier] = "latest",
        eip1559_speed: Optional[TxSpeed] = None,
    ) -> Tuple[HexBytes, TxParams]:
        sender_account = Account.from_key(tx_sender_private_key)
        if eip1559_speed and self.ethereum_client.is_eip1559_supported():
            tx_parameters = self.ethereum_client.set_eip1559_fees(
                {
                    "from": sender_account.address,
                },
                tx_speed=eip1559_speed,
            )
        else:
            tx_parameters = {
                "from": sender_account.address,
                "gasPrice": tx_gas_price or self.gas_price or self.w3.eth.gas_price,
            }
        if tx_gas:
            tx_parameters["gas"] = tx_gas
        if tx_nonce is not None:
            tx_parameters["nonce"] = tx_nonce
        self.tx = self.w3_tx.buildTransaction(tx_parameters)
        self.tx["gas"] = Wei(
            tx_gas or (max(self.tx["gas"] + 75000, self.recommended_gas()))
        )
        self.tx_hash = self.ethereum_client.send_unsigned_transaction(
            self.tx,
            private_key=sender_account.key,
            retry=False if tx_nonce is not None else True,
            block_identifier=block_identifier,
        )
        self.signatures = b""
        return self.tx_hash, self.tx
def execute ( self , tx_sender_private_key : str , tx_gas : Optional [ int ] = None , tx_gas_price : Optional [ int ] = None , tx_nonce : Optional [ int ] = None , block_identifier : Optional [ BlockIdentifier ] = "latest" , eip1559_speed : Optional [ TxSpeed ] = None , ) -> Tuple [ HexBytes , TxParams ] : sender_account = Account . from_key ( tx_sender_private_key ) if eip1559_speed and self . ethereum_client . is_eip1559_supported ( ) : tx_parameters = self . ethereum_client . set_eip1559_fees ( { "from" : sender_account . address , } , tx_speed = eip1559_speed , ) else : tx_parameters = { "from" : sender_account . address , "gasPrice" : tx_gas_price or self . gas_price or self . w3 . eth . gas_price , } if tx_gas : tx_parameters [ "gas" ] = tx_gas if tx_nonce is not None : tx_parameters [ "nonce" ] = tx_nonce self . tx = self . w3_tx . buildTransaction ( tx_parameters ) self . tx [ "gas" ] = Wei ( tx_gas or ( max ( self . tx [ "gas" ] + 75000 , self . recommended_gas ( ) ) ) ) self . tx_hash = self . ethereum_client . send_unsigned_transaction ( self . tx , private_key = sender_account . key , retry = False if tx_nonce is not None else True , block_identifier = block_identifier , ) self . signatures = b"" return self . tx_hash , self . tx
Send multisig tx to the Safe
Send multisig tx to the Safe
"""
        Send multisig tx to the Safe

        :param tx_sender_private_key: Sender private key
        :param tx_gas: Gas for the external tx. If not, `(safe_tx_gas + base_gas) * 2` will be used
        :param tx_gas_price: Gas price of the external tx. If not, `gas_price` will be used
        :param tx_nonce: Force nonce for `tx_sender`
        :param block_identifier: `latest` or `pending`
        :param eip1559_speed: If provided, use EIP1559 transaction
        :return: Tuple(tx_hash, tx)
        :raises: InvalidMultisigTx: If user tx cannot go through the Safe
        """ # Set signatures empty after executing the tx. `Nonce` is increased even if it fails, # so signatures are not valid anymore
None
If user tx cannot go through the Safe
If user tx cannot go through the Safe
self
tx_sender_private_key
str
Sender private key
Sender private key
tx_gas
Optional[int]
Gas for the external tx. If not, `(safe_tx_gas + base_gas) * 2` will be used
Gas for the external tx . If not ` ( safe_tx_gas + base_gas ) * 2 ` will be used
tx_gas_price
Optional[int]
Gas price of the external tx. If not, `gas_price` will be used
Gas price of the external tx . If not ` gas_price ` will be used
tx_nonce
Optional[int]
Force nonce for `tx_sender`
Force nonce for ` tx_sender `
block_identifier
Optional[BlockIdentifier]
`latest` or `pending`
` latest ` or ` pending `
eip1559_speed
Optional[TxSpeed]
If provided, use EIP1559 transaction
If provided use EIP1559 transaction