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.2.tar.gz (380.2 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.2-py3-none-any.whl (356.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omnichain-0.0.2.tar.gz
  • Upload date:
  • Size: 380.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.12 HTTPX/0.28.1

File hashes

Hashes for omnichain-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7a3dcc16943ee4a01c4552910c825cd1fa86a715cf658a1364ef65b976308c13
MD5 ba47acbeae1c43e1a292e752bacbcbff
BLAKE2b-256 a8dd1acfe50ca63fe11d3f6f8b865e1189323b9f2341d5836002e2329ff3ea84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omnichain-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 356.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.12.12 HTTPX/0.28.1

File hashes

Hashes for omnichain-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 60eb98386f20f78c0d10705aaa4b5f23ae1fdeea73e38d43856f4b794fa51ac3
MD5 b67452bf542c961d480cbe4f5ecd8f8b
BLAKE2b-256 b66ec39a4b832708cb0f97b6091783623a6b691b776c32fca2ffa7e3a45675c0

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.3

2 files

This release

0.0.2 This release

2 files

0.0.1

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