Skip to content

added support for new testnets in blockfrost #80

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

Merged
merged 5 commits into from
Aug 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pycardano/backend/blockfrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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(
Expand Down