HotWalletTransactionBuilder#

tradeexecutor.ethereum.tx.HotWalletTransactionBuilder Python class in Trading Strategy framework.

class HotWalletTransactionBuilder[source]#

Bases: TransactionBuilder

Create transactions from the hot wallet and store them in the state.

Creates trackable transactions. TransactionHelper is initialised at the start of the each cycle.

Transaction builder can prepare multiple transactions in one batch. For all tranactions, we use the previously prepared gas price information.

__init__(web3, hot_wallet)[source]#
Parameters:

Methods

__init__(web3, hot_wallet)

broadcast(tx)

Broadcast the transaction.

broadcast_and_wait_transactions_to_complete(...)

Watch multiple transactions executed at parallel.

decode_signed_bytes(tx)

Get raw transaction data out from the signed tx bytes.

fetch_gas_price_suggestion()

Calculate the suggested gas price based on a policy.

get_erc_20_balance_address()

Get the address that holds ERC-20 supply

get_gas_wallet_address()

Get the address that holds native token for gas fees

get_gas_wallet_balance()

Get the balance of the native currency (ETH, BNB, MATIC) of the wallet.

get_token_delivery_address()

Get the target address for ERC-20 approve()

init()

Initialise the transaction builder.

serialise_to_broadcast_format(tx)

Prepare a transaction as a format ready to broadcast.

sign_transaction(contract, args_bound_func)

Sign a transaction with the hot wallet private key.

__init__(web3, hot_wallet)[source]#
Parameters:
init()[source]#

Initialise the transaction builder.

Called on application startup.

get_token_delivery_address()[source]#

Get the target address for ERC-20 approve()

Return type:

str

get_erc_20_balance_address()[source]#

Get the address that holds ERC-20 supply

Return type:

str

get_gas_wallet_address()[source]#

Get the address that holds native token for gas fees

Return type:

str

get_gas_wallet_balance()[source]#

Get the balance of the native currency (ETH, BNB, MATIC) of the wallet.

Useful to check if you have enough cryptocurrency for the gas fees.

Return type:

Decimal

sign_transaction(contract, args_bound_func, gas_limit=None, gas_price_suggestion=None, asset_deltas=None)[source]#

Sign a transaction with the hot wallet private key.

Parameters:
Return type:

BlockchainTransaction