BaseWallet
Documentation for eth_defi.basewallet.BaseWallet Python class.
- class BaseWallet
Bases:
abc.ABCAbstract base class for Ethereum wallets.
This interface defines the common contract that both HotWallet and HSM-based wallets must implement.
Attributes summary
Get the wallet's Ethereum address.
Methods summary
__init__()Get the next available nonce.
fill_in_gas_price(web3, tx)Fill in gas price details for a transaction.
Get the main Ethereum address for this wallet.
Get the wallet's native currency balance.
sign_bound_call_with_new_nonce(func[, tx_params])Sign a contract function call with a new nonce.
Sign a transaction with a new nonce.
sync_nonce(web3)Synchronize the nonce with the blockchain.
- abstract property address: eth_typing.evm.HexAddress
Get the wallet’s Ethereum address.
- abstract get_main_address()
Get the main Ethereum address for this wallet.
- Return type
- abstract sync_nonce(web3)
Synchronize the nonce with the blockchain.
- Parameters
web3 (web3.main.Web3) –
- Return type
None
- abstract allocate_nonce()
Get the next available nonce.
- Return type
- abstract sign_transaction_with_new_nonce(tx)
Sign a transaction with a new nonce.
- Parameters
tx (dict) –
- Return type
- abstract sign_bound_call_with_new_nonce(func, tx_params=None)
Sign a contract function call with a new nonce.
- Parameters
- Return type
- abstract get_native_currency_balance(web3)
Get the wallet’s native currency balance.
- Parameters
web3 (web3.main.Web3) –
- Return type