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

blockfrost.utils.ApiError width backends MinswapCPPState, MinswapV2CPPState #106

Open
Rot-Front opened this issue Oct 22, 2024 · 0 comments

Comments

@Rot-Front
Copy link

Using pool_selector() for MinswapCPPState and MinswapV2CPPState backends returns an error:

 File "...\charl.py", line 23, in <module>
    result = backend.get_pool_utxos(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "...\site-packages\charli3_dendrite\backend\blockfrost\__init__.py", line 88, in get_pool_utxos
    self.api.address_utxos_asset(address, asset, gather_pages=True),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\site-packages\blockfrost\utils.py", line 100, in pagination
    recursive_append(json_list, *args, **kwargs)
  File "...\site-packages\blockfrost\utils.py", line 83, in recursive_append
    raise ApiError(request_response)
blockfrost.utils.ApiError: {'status_code': 404, 'error': 'Not Found', 'message': 'The requested component has not been found.'}

The code that reproduces the error:

import os
os.environ["BLOCKFROST_PROJECT_ID"] = "my-BlockFrost-id"
os.environ["CARDANO_NETWORK"] = "mainnet"
os.environ["AXO_API_KEY"] = ""

from charli3_dendrite.backend import set_backend, get_backend
from charli3_dendrite.backend.dbsync import DbsyncBackend
from charli3_dendrite.backend.blockfrost import BlockFrostBackend
from charli3_dendrite.backend.ogmios_kupo import OgmiosKupoBackend
from pycardano import Network

# Choose one of the following backends:
# set_backend(DbsyncBackend())
set_backend(BlockFrostBackend("my-BlockFrost-id"))
#set_backend(OgmiosKupoBackend("ws://ogmios-url:port", "http://kupo-url:port", Network.MAINNET))

backend = get_backend()

#from charli3_dendrite import VyFiCPPState
from charli3_dendrite import MinswapV2CPPState
selector = MinswapV2CPPState.pool_selector()

result = backend.get_pool_utxos(
    limit=10000,
    historical=False,
    **selector.model_dump(),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant