MCPcopy Create free account
hub / github.com/blockfrost/blockfrost-python / BlockFrostApi

Class BlockFrostApi

blockfrost/api/__init__.py:10–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class BlockFrostApi(Api):
11
12 def __init__(self, project_id: str = None, base_url: str = None, api_version: str = None):
13 super().__init__(
14 project_id=project_id,
15 base_url=base_url if base_url else os.environ.get(
16 'BLOCKFROST_API_URL', default=ApiUrls.mainnet.value),
17 # if custom base_url is specified then also use specified api_version
18 api_version=api_version if base_url else os.environ.get('BLOCKFROST_API_VERSION',
19 default=DEFAULT_API_VERSION))
20
21 @request_wrapper
22 def root(self, **kwargs):
23 """
24 Root endpoint has no other function than to point end users to documentation.
25
26 https://docs.blockfrost.io/#tag/health/GET/
27 :param return_type: Optional. "object", "json" or "pandas". Default: "object".
28 :type return_type: str
29 :returns RootResponse object.
30 :rtype RootResponse
31 :raises ApiError: If API fails
32 :raises Exception: If the API response is somehow malformed.
33 """
34 return requests.get(
35 url=f"{self.url}/",
36 headers=self.authentication_header
37 )
38
39 from .health import \
40 health, \
41 clock
42 from .metrics import \
43 metrics, \
44 metrics_endpoints
45 from .nutlink import \
46 nutlink_address, \
47 nutlink_address_tickers, \
48 nutlink_address_ticker, \
49 nutlink_ticker
50 from .cardano.accounts import \
51 accounts, \
52 account_rewards, \
53 account_history, \
54 account_delegations, \
55 account_registrations, \
56 account_withdrawals, \
57 account_mirs, \
58 account_addresses, \
59 account_addresses_assets, \
60 account_addresses_total, \
61 account_utxos, \
62 account_transactions
63 from .cardano.addresses import \
64 address, \
65 address_extended, \
66 address_total, \
67 address_utxos, \

Callers 15

test_genesisFunction · 0.90
test_integration_genesisFunction · 0.90
test_healthFunction · 0.90
test_integration_healthFunction · 0.90
test_clockFunction · 0.90
test_integration_clockFunction · 0.90
test_epoch_latestFunction · 0.90
test_epochFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_genesisFunction · 0.72
test_integration_genesisFunction · 0.72
test_healthFunction · 0.72
test_integration_healthFunction · 0.72
test_clockFunction · 0.72
test_integration_clockFunction · 0.72
test_epoch_latestFunction · 0.72
test_epochFunction · 0.72
test_integration_epochFunction · 0.72