11from typing import (
22 TYPE_CHECKING ,
3+ Any ,
34 Dict ,
45 Final ,
56 Optional ,
4748
4849# unused vars present in these funcs because they all need to have the same signature
4950async def _estimate_gas (
50- async_w3 : "AsyncWeb3" , tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
51+ async_w3 : "AsyncWeb3[Any] " , tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
5152) -> int :
5253 return await async_w3 .eth .estimate_gas (tx )
5354
5455
5556async def _max_fee_per_gas (
56- async_w3 : "AsyncWeb3" , tx : TxParams , defaults : Dict [str , Union [bytes , int ]]
57+ async_w3 : "AsyncWeb3[Any] " , tx : TxParams , defaults : Dict [str , Union [bytes , int ]]
5758) -> Wei :
5859 block = await async_w3 .eth .get_block ("latest" )
5960 max_priority_fee = tx .get (
@@ -63,13 +64,13 @@ async def _max_fee_per_gas(
6364
6465
6566async def _max_priority_fee_gas (
66- async_w3 : "AsyncWeb3" , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
67+ async_w3 : "AsyncWeb3[Any] " , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
6768) -> Wei :
6869 return await async_w3 .eth .max_priority_fee
6970
7071
7172async def _chain_id (
72- async_w3 : "AsyncWeb3" , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
73+ async_w3 : "AsyncWeb3[Any] " , _tx : TxParams , _defaults : Dict [str , Union [bytes , int ]]
7374) -> int :
7475 return await async_w3 .eth .chain_id
7576
@@ -93,7 +94,7 @@ async def get_block_gas_limit(
9394
9495
9596async def get_buffered_gas_estimate (
96- async_w3 : "AsyncWeb3" , transaction : TxParams , gas_buffer : int = 100000
97+ async_w3 : "AsyncWeb3[Any] " , transaction : TxParams , gas_buffer : int = 100000
9798) -> int :
9899 gas_estimate_transaction = cast (TxParams , dict (** transaction ))
99100
@@ -111,7 +112,9 @@ async def get_buffered_gas_estimate(
111112 return min (gas_limit , gas_estimate + gas_buffer )
112113
113114
114- async def async_fill_nonce (async_w3 : "AsyncWeb3" , transaction : TxParams ) -> TxParams :
115+ async def async_fill_nonce (
116+ async_w3 : "AsyncWeb3[Any]" , transaction : TxParams
117+ ) -> TxParams :
115118 if "from" in transaction and "nonce" not in transaction :
116119 tx_count = await async_w3 .eth .get_transaction_count (
117120 cast (ChecksumAddress , transaction ["from" ]),
@@ -122,7 +125,7 @@ async def async_fill_nonce(async_w3: "AsyncWeb3", transaction: TxParams) -> TxPa
122125
123126
124127async def async_fill_transaction_defaults (
125- async_w3 : "AsyncWeb3" , transaction : TxParams
128+ async_w3 : "AsyncWeb3[Any] " , transaction : TxParams
126129) -> TxParams :
127130 """
128131 If async_w3 is None, fill as much as possible while offline
@@ -166,7 +169,7 @@ async def async_fill_transaction_defaults(
166169
167170
168171async def async_get_required_transaction (
169- async_w3 : "AsyncWeb3" , transaction_hash : _Hash32
172+ async_w3 : "AsyncWeb3[Any] " , transaction_hash : _Hash32
170173) -> TxData :
171174 current_transaction = await async_w3 .eth .get_transaction (transaction_hash )
172175 if not current_transaction :
@@ -177,7 +180,7 @@ async def async_get_required_transaction(
177180
178181
179182async def async_replace_transaction (
180- async_w3 : "AsyncWeb3" , current_transaction : TxData , new_transaction : TxParams
183+ async_w3 : "AsyncWeb3[Any] " , current_transaction : TxData , new_transaction : TxParams
181184) -> HexBytes :
182185 new_transaction = prepare_replacement_transaction (
183186 async_w3 , current_transaction , new_transaction
0 commit comments