diff --git a/pycardano/backend/blockfrost.py b/pycardano/backend/blockfrost.py index 646a78f7..06c027c6 100644 --- a/pycardano/backend/blockfrost.py +++ b/pycardano/backend/blockfrost.py @@ -43,11 +43,15 @@ class BlockFrostChainContext(ChainContext): network (Network): Network to use. """ - def __init__(self, project_id: str, network: Network = Network.TESTNET): + def __init__( + self, project_id: str, network: Network = Network.TESTNET, base_url: str = None + ): self._network = network self._project_id = project_id self._base_url = ( - ApiUrls.testnet.value + base_url + if base_url + else ApiUrls.testnet.value if self.network == Network.TESTNET else ApiUrls.mainnet.value ) @@ -176,7 +180,10 @@ def utxos(self, address: str) -> List[UTxO]: script = None - if hasattr(result, "reference_script_hash") and result.reference_script_hash: + if ( + hasattr(result, "reference_script_hash") + and result.reference_script_hash + ): script = self._get_script(result.reference_script_hash) tx_out = TransactionOutput(