@@ -84,7 +84,7 @@ def get_exchange_contract(
8484 self .network_id ,
8585 )
8686 )
87- contract_address = Web3 .toChecksumAddress (contract_address )
87+ contract_address = Web3 .to_checksum_address (contract_address )
8888 return self .get_contract (contract_address , STARKWARE_PERPETUALS_ABI )
8989
9090 def get_token_contract (
@@ -101,7 +101,7 @@ def get_token_contract(
101101 self .network_id ,
102102 )
103103 )
104- token_address = Web3 .toChecksumAddress (token_address )
104+ token_address = Web3 .to_checksum_address (token_address )
105105 return self .get_contract (token_address , ERC20_ABI )
106106
107107 def send_eth_transaction (
@@ -123,7 +123,7 @@ def send_eth_transaction(
123123 if 'gasPrice' not in options :
124124 try :
125125 options ['gasPrice' ] = (
126- self .web3 .eth .gasPrice + DEFAULT_GAS_PRICE_ADDITION
126+ self .web3 .eth .gas_price + DEFAULT_GAS_PRICE_ADDITION
127127 )
128128 except Exception :
129129 options ['gasPrice' ] = DEFAULT_GAS_PRICE
@@ -140,7 +140,7 @@ def send_eth_transaction(
140140
141141 signed = self .sign_tx (method , options )
142142 try :
143- tx_hash = self .web3 .eth .sendRawTransaction (signed .rawTransaction )
143+ tx_hash = self .web3 .eth .send_raw_transaction (signed .rawTransaction )
144144 except ValueError as error :
145145 while (
146146 auto_detect_nonce and
@@ -152,7 +152,7 @@ def send_eth_transaction(
152152 try :
153153 options ['nonce' ] += 1
154154 signed = self .sign_tx (method , options )
155- tx_hash = self .web3 .eth .sendRawTransaction (
155+ tx_hash = self .web3 .eth .send_raw_transaction (
156156 signed .rawTransaction ,
157157 )
158158 except ValueError as inner_error :
@@ -173,7 +173,7 @@ def get_next_nonce(
173173 ):
174174 if self ._next_nonce_for_address .get (ethereum_address ) is None :
175175 self ._next_nonce_for_address [ethereum_address ] = (
176- self .web3 .eth .getTransactionCount (ethereum_address )
176+ self .web3 .eth .get_transaction_count (ethereum_address )
177177 )
178178 return self ._next_nonce_for_address [ethereum_address ]
179179
@@ -205,7 +205,7 @@ def wait_for_tx(
205205
206206 :raises: TransactionReverted
207207 '''
208- tx_receipt = self .web3 .eth .waitForTransactionReceipt (tx_hash )
208+ tx_receipt = self .web3 .eth .wait_for_transaction_receipt (tx_hash )
209209 if tx_receipt ['status' ] == 0 :
210210 raise TransactionReverted (tx_receipt )
211211
@@ -400,7 +400,7 @@ def transfer_eth(
400400 options = dict (
401401 send_options ,
402402 to = to_address ,
403- value = Web3 .toWei (human_amount , 'ether' ),
403+ value = Web3 .to_wei (human_amount , 'ether' ),
404404 ),
405405 )
406406
@@ -512,8 +512,8 @@ def get_eth_balance(
512512 'owner was not provided, and no default address is set' ,
513513 )
514514
515- wei_balance = self .web3 .eth .getBalance (owner )
516- return Web3 .fromWei (wei_balance , 'ether' )
515+ wei_balance = self .web3 .eth .get_eth_balance (owner )
516+ return Web3 .from_wei (wei_balance , 'ether' )
517517
518518 def get_token_balance (
519519 self ,
0 commit comments