Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api Update #46

Closed
solarthesis opened this issue May 28, 2024 · 2 comments · Fixed by #47
Closed

Api Update #46

solarthesis opened this issue May 28, 2024 · 2 comments · Fixed by #47
Assignees
Labels
bug Something isn't working

Comments

@solarthesis
Copy link
Contributor

solarthesis commented May 28, 2024

Environment information

  • ape and plugin versions:
$ ape --version
0.7.23

$ ape plugins list
Installed Plugins
  alchemy      0.7.3
  etherscan    0.7.4
  foundry      0.7.5
  optimism     0.7.3
  safe         0.7.0b2
  solidity     0.7.3
  • Python Version: 3.12
    b- OS: osx/linux/win linux

What went wrong?

The safe api changed for fetching transactions, i believe v1/safes/{address}/transactions/ no longer works and is now
https://safe-transaction-optimism.safe.global/
/v1/safes/{address}/all-transactions/

url = f"safes/{self.address}/transactions"

Please include information like:

  • what command you ran
txn            = multisend.MultiSend()
txn(sender=self.safe,gas=0,submit_transaction=False,nonce=nonce)

Trying to push

  • the code that caused the failure (see this link for help with formatting code)
  • full output of the error you received
Traceback (most recent call last):
  File "/home/thesis/repos/gnosis_perp_ape/main.py", line 58, in <module>
    self.setup_gnosis_perp_parameter_change(args.p)
  File "/home/thesis/repos/gnosis_perp_ape/utils/controller.py", line 75, in setup_gnosis_perp_parameter_change
    self.post_gnosis_transaction(contractName='perp_settings',functionName=functionName,args=stagedParams)    
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/repos/gnosis_perp_ape/utils/gnosis_safe.py", line 24, in wrapper
    return func(self,*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/repos/gnosis_perp_ape/utils/gnosis_safe.py", line 64, in post_gnosis_transaction
    nonce          = self.get_next_safe_nonce()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/repos/gnosis_perp_ape/utils/gnosis_safe.py", line 24, in wrapper
    return func(self,*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/repos/gnosis_perp_ape/utils/gnosis_safe.py", line 60, in get_next_safe_nonce
    return self.safe.new_nonce
           ^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/miniconda3/envs/gnosis_perp_ape/lib/python3.12/site-packages/ape_safe/accounts.py", line 322, in new_nonce
    if latest_tx := next(self.client.get_transactions(confirmed=False), None):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/miniconda3/envs/gnosis_perp_ape/lib/python3.12/site-packages/ape_safe/client/base.py", line 81, in get_transactions
    for txn in self._all_transactions():
  File "/home/thesis/miniconda3/envs/gnosis_perp_ape/lib/python3.12/site-packages/ape_safe/client/__init__.py", line 86, in _all_transactions
    response = self._get(url)
               ^^^^^^^^^^^^^^
  File "/home/thesis/miniconda3/envs/gnosis_perp_ape/lib/python3.12/site-packages/ape_safe/client/base.py", line 128, in _get
    return self._request("GET", url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thesis/miniconda3/envs/gnosis_perp_ape/lib/python3.12/site-packages/ape_safe/client/base.py", line 153, in _request
    raise ClientResponseError(api_url, response)
ape_safe.exceptions.ClientResponseError: Exception when calling 'https://safe-transaction-optimism.safe.global/api/v1/safes/xxxxxxxxxxxxxxxxxxxxx/transactions/':

<!doctype html>
<html lang="en">
<head>
  <title>Not Found</title>
</head>
<body>
  <h1>Not Found</h1><p>The requested resource was not found on this server.</p>
</body>
</html>

How can it be fixed?

Need to update the api

@solarthesis solarthesis added the bug Something isn't working label May 28, 2024
Copy link

linear bot commented May 28, 2024

APE-1749 Api Update

@fubuloubu
Copy link
Member

@solarthesis please check out #47 and let me know if that solves your problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants