diff --git a/src/setup.py b/src/setup.py index 7682832..f678f32 100644 --- a/src/setup.py +++ b/src/setup.py @@ -2,7 +2,7 @@ setup( name="synthetix", - version="0.1.14", + version="0.1.15", description="Synthetix protocol SDK", long_description=open("README.md").read(), long_description_content_type="text/markdown", diff --git a/src/synthetix/perps/constants.py b/src/synthetix/perps/constants.py index f5bf340..ac28b30 100644 --- a/src/synthetix/perps/constants.py +++ b/src/synthetix/perps/constants.py @@ -1,3 +1,4 @@ DISABLED_MARKETS = { - 8453: [6300] + 8453: [6300], + 84532: [6300], } \ No newline at end of file diff --git a/src/synthetix/perps/perps.py b/src/synthetix/perps/perps.py index 1a46689..fed9027 100644 --- a/src/synthetix/perps/perps.py +++ b/src/synthetix/perps/perps.py @@ -54,7 +54,7 @@ def __init__(self, snx, default_account_id: int = None, disabled_markets=None): if disabled_markets is None and snx.network_id in DISABLED_MARKETS: self.disabled_markets = DISABLED_MARKETS[snx.network_id] else: - self.disabled_markets = [] + self.disabled_markets = disabled_markets if disabled_markets else [] # check if perps is deployed on this network if "perpsFactory" in snx.contracts: diff --git a/src/synthetix/synthetix.py b/src/synthetix/synthetix.py index 08a697b..69cca2b 100644 --- a/src/synthetix/synthetix.py +++ b/src/synthetix/synthetix.py @@ -534,12 +534,18 @@ def approve( ) tx_params = self._get_tx_params() + + # reset nonce on internal transactions + self.nonce = self.web3.eth.get_transaction_count(self.address) + tx_params["nonce"] = self.nonce + + # simulate the transaction tx_params = token_contract.functions.approve( target_address, amount ).build_transaction(tx_params) if submit: - tx_hash = self.execute_transaction(tx_params, reset_nonce=True) + tx_hash = self.execute_transaction(tx_params) self.logger.info( f"Approving {target_address} to spend {amount / 1e18} {token_address} for {self.address}" ) @@ -606,12 +612,18 @@ def wrap_eth(self, amount: float, submit: bool = False) -> str: tx_args = [] tx_params = self._get_tx_params(value=value_wei) + + # reset nonce on internal transactions + self.nonce = self.web3.eth.get_transaction_count(self.address) + tx_params["nonce"] = self.nonce + + # simulate the transaction tx_params = weth_contract.functions[fn_name](*tx_args).build_transaction( tx_params ) if submit: - tx_hash = self.execute_transaction(tx_params, reset_nonce=True) + tx_hash = self.execute_transaction(tx_params) self.logger.info(f"Wrapping {amount} ETH for {self.address}") self.logger.info(f"wrap_eth tx: {tx_hash}") return tx_hash