perform_gas_level_checks#

API documentation for tradeexecutor.ethereum.wallet.perform_gas_level_checks Python function.

perform_gas_level_checks(web3, run_state, hot_wallet, hot_wallet_gas_warning_level=None)[source]#

Check the gas level of the hot wallet.

  • We need gas money to perform transactions

  • Issue a low gas warnign if gas is running low

  • Print a log message

  • Set RunState` flag.

  • Does not do anything if warning gas level is not set

  • Clear the existing warning, if the gas warning light is on

Parameters:
  • hot_wallet_gas_warning_level (Optional[Decimal]) – Set this or one in RunState.hot_wallet_gas_warning_level.

  • web3 (Web3) –

  • run_state (RunState) –

  • hot_wallet (HotWallet) –

Returns:

True if the gas warning is going

Return type:

bool