Skip to main content

Chain Contexts for PyCardano library

Project description

PyCardano Chain Contexts

This library contains the various Chain Contexts to use with the PyCardano library.

Basic Usage

Blockfrost

from pccontext import BlockFrostChainContext
from blockfrost import ApiUrls

chain_context = BlockFrostChainContext(
    project_id="your_project_id",
    base_url=ApiUrls.mainnet.value
)

Cardano-CLI

from pccontext import CardanoCliChainContext, CardanoCliNetwork
from pathlib import Path

chain_context = CardanoCliChainContext(
            binary=Path("cardano-cli"),
            socket=Path("node.socket"),
            config_file=Path("config.json"),
            network=CardanoCliNetwork.MAINNET,
)

Koios

from pccontext import KoiosChainContext

chain_context = KoiosChainContext(api_key="api_key")

Ogmios

from pccontext import OgmiosChainContext

chain_context = OgmiosChainContext(host="localhost", port=1337)

Kupo

from pccontext import OgmiosChainContext, KupoChainContextExtension

ogmios_chain_context = OgmiosChainContext(host="localhost", port=1337)
chain_context = KupoChainContextExtension(wrapped_backend=ogmios_chain_context)

Offline Transfer File

from pathlib import Path
from pccontext import OfflineTransferFileContext

chain_context = OfflineTransferFileContext(offline_transfer_file=Path("offline-transfer.json"))

Yaci Devkit

from pccontext import YaciDevkitChainContext

chain_context = YaciDevkitChainContext(api_url="http://localhost:8080")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pccontext-0.2.1.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

pccontext-0.2.1-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

Details for the file pccontext-0.2.1.tar.gz.

File metadata

  • Download URL: pccontext-0.2.1.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.10.10 Darwin/24.0.0

File hashes

Hashes for pccontext-0.2.1.tar.gz
Algorithm Hash digest
SHA256 563c4c597807c9b91ed2e2d2c16f94b52671afc7144c34bbe23d54bf8a9ea49a
MD5 441e677371a9e365d91d7e22a133d82c
BLAKE2b-256 8d13340a63b5a1ef976c19e6b154f56b1403870e356da0c22c0f5a31a28d8192

See more details on using hashes here.

File details

Details for the file pccontext-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pccontext-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 44.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.10.10 Darwin/24.0.0

File hashes

Hashes for pccontext-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7884c472e4f84b88f97dc51e930c8f688fa6f2027c2e408e9b4e7fceb1fd3771
MD5 94672a89aefd576d16f09b62d20c6ca1
BLAKE2b-256 e3213a762022cdbeb0395f81b5f6eca3a634cb74cfa88c2b92f38e3f3f5b6cef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page