Skip to main content

Omnichain

Omnichain-py is a python library for humans and AI Agents to interact with all blockchain networks

Supported Blockchain Networks

  • EVM
  • UTXO (Bitcoin and bit-like networks)
  • Solana
  • Sui
  • Stellar
  • XRP Ledger
  • Tron
  • TON

Installation

pip install omnichain

Development

This project uses Hatch for environment, build, and publish management.

# install hatch (once)
pip install hatch

# run tests inside the managed environment
hatch run test

# build sdist + wheel into ./dist
hatch build

# bump version (edits src/omnichain/__init__.py)
hatch version patch   # or: minor / major / "1.2.3"

# publish to PyPI (needs HATCH_INDEX_USER / HATCH_INDEX_AUTH or ~/.pypirc)
hatch publish

Running tests

The default Hatch environment defines test = "pytest {args:tests}", so any arguments after hatch run test are forwarded to pytest.

# run the entire test suite
hatch run test

# run a specific file
hatch run test tests/impl/evm/test_evm_chain_e2e.py
hatch run test tests/impl/solana/test_solana_chain_e2e.py

# run a single class
hatch run test tests/impl/evm/test_evm_chain_e2e.py::TestEvmChains
hatch run test tests/impl/solana/test_solana_chain_e2e.py::TestSolanaChainGenesisHash

# run a single parametrized case (quote because of the brackets)
hatch run test "tests/impl/evm/test_evm_chain_e2e.py::TestEvmChains::test_asset_symbol_and_decimals_match_chain[ETHEREUM_USDC]"
hatch run test "tests/impl/solana/test_solana_chain_e2e.py::TestSolanaChainGenesisHash::test_asset_symbol_and_decimals_match_chain[SOLANA_MAINNET_USDC]"

# forward extra pytest flags
hatch run test tests/impl/solana/test_solana_chain_e2e.py -k genesis_hash -x -s

# one-off invocation without the script alias
hatch run pytest tests/impl/solana/test_solana_chain_e2e.py

# drop into the env shell and run pytest directly
hatch shell
pytest tests/impl/evm/test_evm_chain_e2e.py

Running groups of tests by marker

pytest.ini registers markers for both the kind of test (unit, integration, e2e) and the network it exercises (evm, solana, stellar, sui, sui_graphql, tron, xrpl). Use -m to select tests by marker:

# run all unit / integration / e2e tests
hatch run test -m unit
hatch run test -m integration
hatch run test -m e2e

# run all tests for a specific network
hatch run test -m evm
hatch run test -m solana
hatch run test -m sui_graphql

# combine markers with boolean expressions
hatch run test -m "e2e and evm"            # only EVM e2e tests
hatch run test -m "unit or integration"    # everything except e2e
hatch run test -m "evm and not e2e"        # EVM unit + integration only
hatch run test -m "e2e and (solana or sui)"

# chain a marker selection with a name filter and a path
hatch run test tests/impl/evm -m e2e -k genesis_hash

E2E tests load tests/.test.env themselves via python-dotenv, so Hatch needs no extra config — just populate tests/.test.env with the RPC URLs and TEST_1_MNEMONIC / TEST_2_MNEMONIC you want to exercise. Tests whose required env vars are missing are skipped automatically.

License

MIT — see LICENSE.

Download files

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

Source Distribution

omnichain-0.0.1.tar.gz (299.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnichain-0.0.1-py3-none-any.whl (291.1 kB view details)

Uploaded Python 3

File details

Details for the file omnichain-0.0.1.tar.gz.

File metadata

  • Download URL: omnichain-0.0.1.tar.gz
  • Upload date:
  • Size: 299.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for omnichain-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c42e70f33467f6de4ef8e6cabb2529e93e8d63b6647d6957be381c6a75e49e51
MD5 3bc3980c5cd6f34c3df5ac1dd2927fb7
BLAKE2b-256 8f30712769673f359cb2bae3427df17c4c41dce98490768e8c54777fd48c4add

See more details on using hashes here.

File details

Details for the file omnichain-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: omnichain-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 291.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for omnichain-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8a1a1487f62142032678d9625ccb527f7c670adade330545f54e4456c02995
MD5 86a2227559dc157d6ddfa09368ba6604
BLAKE2b-256 532f4337697a2528aa1c6965f79570b844208b7797d4b763fdff7d34b1a2c597

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.3

2 files

0.0.2

2 files

This release

0.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page