11from typing import (
22 TYPE_CHECKING ,
3+ Any ,
34 Dict ,
45 Optional ,
56 Union ,
4647
4748# unused vars present in these funcs because they all need to have the same signature
4849async def _estimate_gas (
49- async_w3 : "AsyncWeb3" , tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
50+ async_w3 : "AsyncWeb3[Any] " , tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
5051) -> int :
5152 return await async_w3 .eth .estimate_gas (tx )
5253
5354
5455async def _max_fee_per_gas (
55- async_w3 : "AsyncWeb3" , tx : TxParams , defaults : Dict [str , Union [bytes , int ]]
56+ async_w3 : "AsyncWeb3[Any] " , tx : TxParams , defaults : Dict [str , Union [bytes , int ]]
5657) -> Wei :
5758 block = await async_w3 .eth .get_block ("latest" )
5859 max_priority_fee = tx .get (
@@ -62,13 +63,13 @@ async def _max_fee_per_gas(
6263
6364
6465async def _max_priority_fee_gas (
65- async_w3 : "AsyncWeb3" , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
66+ async_w3 : "AsyncWeb3[Any] " , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
6667) -> Wei :
6768 return await async_w3 .eth .max_priority_fee
6869
6970
7071async def _chain_id (
71- async_w3 : "AsyncWeb3" , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
72+ async_w3 : "AsyncWeb3[Any] " , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
7273) -> int :
7374 return await async_w3 .eth .chain_id
7475
@@ -92,7 +93,7 @@ async def get_block_gas_limit(
9293
9394
9495async def get_buffered_gas_estimate (
95- async_w3 : "AsyncWeb3" , transaction : TxParams , gas_buffer : int = 100000
96+ async_w3 : "AsyncWeb3[Any] " , transaction : TxParams , gas_buffer : int = 100000
9697) -> int :
9798 gas_estimate_transaction = cast (TxParams , dict (** transaction ))
9899
@@ -110,7 +111,9 @@ async def get_buffered_gas_estimate(
110111 return min (gas_limit , gas_estimate + gas_buffer )
111112
112113
113- async def async_fill_nonce (async_w3 : "AsyncWeb3" , transaction : TxParams ) -> TxParams :
114+ async def async_fill_nonce (
115+ async_w3 : "AsyncWeb3[Any]" , transaction : TxParams
116+ ) -> TxParams :
114117 if "from" in transaction and "nonce" not in transaction :
115118 tx_count = await async_w3 .eth .get_transaction_count (
116119 cast (ChecksumAddress , transaction ["from" ]),
@@ -121,7 +124,7 @@ async def async_fill_nonce(async_w3: "AsyncWeb3", transaction: TxParams) -> TxPa
121124
122125
123126async def async_fill_transaction_defaults (
124- async_w3 : "AsyncWeb3" , transaction : TxParams
127+ async_w3 : "AsyncWeb3[Any] " , transaction : TxParams
125128) -> TxParams :
126129 """
127130 If async_w3 is None, fill as much as possible while offline
@@ -165,7 +168,7 @@ async def async_fill_transaction_defaults(
165168
166169
167170async def async_get_required_transaction (
168- async_w3 : "AsyncWeb3" , transaction_hash : _Hash32
171+ async_w3 : "AsyncWeb3[Any] " , transaction_hash : _Hash32
169172) -> TxData :
170173 current_transaction = await async_w3 .eth .get_transaction (transaction_hash )
171174 if not current_transaction :
@@ -176,7 +179,7 @@ async def async_get_required_transaction(
176179
177180
178181async def async_replace_transaction (
179- async_w3 : "AsyncWeb3" , current_transaction : TxData , new_transaction : TxParams
182+ async_w3 : "AsyncWeb3[Any] " , current_transaction : TxData , new_transaction : TxParams
180183) -> HexBytes :
181184 new_transaction = prepare_replacement_transaction (
182185 async_w3 , current_transaction , new_transaction
0 commit comments