Skip to content

Commit 9b8f8eb

Browse files
committed
fixed use of outdated Contract API
1 parent 91d7877 commit 9b8f8eb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎uniswap/uniswap.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ def get_fee_taker(self):
9999
return 0.003
100100

101101
# ------ Market --------------------------------------------------------------------
102-
def get_eth_token_input_price(self, token, qty):
102+
def get_eth_token_input_price(self, token: str, qty: int):
103103
"""Public price for ETH to Token trades with an exact input."""
104-
return self.exchange_contract[token].call().getEthToTokenInputPrice(qty)
104+
return self.exchange_contract[token].functions.getEthToTokenInputPrice(qty).call()
105105

106-
def get_token_eth_input_price(self, token, qty):
106+
def get_token_eth_input_price(self, token: str, qty: int):
107107
"""Public price for token to ETH trades with an exact input."""
108-
return self.exchange_contract[token].call().getTokenToEthInputPrice(qty)
108+
return self.exchange_contract[token].functions.getTokenToEthInputPrice(qty).call()
109109

110-
def get_eth_token_output_price(self, token, qty):
110+
def get_eth_token_output_price(self, token: str, qty: int):
111111
"""Public price for ETH to Token trades with an exact output."""
112-
return self.exchange_contract[token].call().getEthToTokenOutputPrice(qty)
112+
return self.exchange_contract[token].functions.getEthToTokenOutputPrice(qty).call()
113113

114-
def get_token_eth_output_price(self, token, qty):
114+
def get_token_eth_output_price(self, token: str, qty: int):
115115
"""Public price for token to ETH trades with an exact output."""
116-
return self.exchange_contract[token].call().getTokenToEthOutputPrice(qty)
116+
return self.exchange_contract[token].functions.getTokenToEthOutputPrice(qty).call()
117117

118118
# ------ ERC20 Pool ----------------------------------------------------------------
119119
def get_eth_balance(self, token):

0 commit comments

Comments
 (0)