.. XChainPy2 documentation master file, created by sphinx-quickstart on Sun May 5 12:05:17 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to XChainPy2's documentation! ===================================== **XChainPy2** is a collection of Python libraries for interacting with various blockchains. It is a freestyle port of XChainJS library, which was written in JavaScript. The goal of XChainPy2 is to provide a simple, consistent interface for interacting with different blockchains, making it easy to build cross-chain applications. .. danger:: **XChainPy2** is still in development and should be considered alpha software. If you intend to use the library for real funds, do so with great caution! **Disclaimer! The authors are not responsible for lost funds!** Please verify the code before using it in a production environment. The source code is available on GitHub: https://github.com/tirinox/xchainpy. Feel free to contribute to the project by opening issues or pull requests. .. warning:: This documentation is also in development and may not be complete or accurate. Please refer to the source code for the most up-to-date information. Quick Start example ------------------- See how easy it is to swap assets using XChainPy2: .. literalinclude:: ./examples/amm_swap.py :language: python More examples ------------- More examples can be found in the `examples` directory. https://github.com/tirinox/xchainpy/tree/main/examples Modular design -------------- The library is designed to be modular, so you can use only the parts you need. It contains the following packages. Essential utilities: #. :mod:`xchainpy2_utils` (:doc:`./packages/xchainpy2_utils`) - A collection of utility functions and classes. It also has widely used Asset, Amount and CryptoAmount classes. #. :mod:`xchainpy2_crypto` (:doc:`./packages/xchainpy2_crypto`) - A collection of cryptographic functions. Keystore, mnemonic, etc. #. :mod:`xchainpy2_client` (:doc:`./packages/xchainpy2_client`) - Base class for blockchain clients. It provides a common interface for interacting with different blockchains. Normally, you will not use this module directly, but use the specific blockchain client modules. AMM and data providers: #. :mod:`xchainpy2_thorchain_query` (:doc:`./packages/xchainpy2_thorchain_query`) - THORChain query module to access the APIs and quote swaps. #. :mod:`xchainpy2_thorchain_amm` (:doc:`./packages/xchainpy2_thorchain_amm`) - THORChain AMM allows you to perform swaps, liquidity actions and all other ThorFi stuff. #. :mod:`xchainpy2_mayanode` (:doc:`./packages/xchainpy2_mayanode`) - MayaNode client package. Autogenerated from MayaNode API. #. :mod:`xchainpy2_thornode` (:doc:`./packages/xchainpy2_thornode`) - ThorNode client package. Autogenerated from ThorNode API. #. :mod:`xchainpy2_midgard` (:doc:`./packages/xchainpy2_midgard`) - Midgard client package. Autogenerated from Midgard API. Chain clients: #. :mod:`xchainpy2_thorchain` (:doc:`./packages/xchainpy2_thorchain`) - THORChain client package. Rune/synth transfer, deposit, etc. #. :mod:`xchainpy2_mayachain` (:doc:`./packages/xchainpy2_mayachain`) - MayaChain client package. It has also basic support for MRC-20 and M-NFT tokens. #. :mod:`xchainpy2_ethereum` (:doc:`./packages/xchainpy2_ethereum`) - Ethereum client package. It allows you to interact with Ethereum and ERC20 tokens. #. :mod:`xchainpy2_arbitrum` (:doc:`./packages/xchainpy2_arbitrum`) - Arbitrum client package. #. :mod:`xchainpy2_avalanche` (:doc:`./packages/xchainpy2_avalanche`) - Avalanche client package. #. :mod:`xchainpy2_bsc` (:doc:`./packages/xchainpy2_bsc`) - Binance Smart Chain client package. #. :mod:`xchainpy2_base` (:doc:`./packages/xchainpy2_base`) - Base client package. #. :mod:`xchainpy2_bitcoin` (:doc:`./packages/xchainpy2_bitcoin`) - Bitcoin client package. #. :mod:`xchainpy2_litecoin` (:doc:`./packages/xchainpy2_litecoin`) - Litecoin client package. #. :mod:`xchainpy2_dogecoin` (:doc:`./packages/xchainpy2_dogecoin`) - Dogecoin client package. #. :mod:`xchainpy2_bitcoincash` (:doc:`./packages/xchainpy2_bitcoincash`) - Bitcoin Cash client package. #. :mod:`xchainpy2_cosmos` (:doc:`./packages/xchainpy2_cosmos`) - Cosmos client package. Wallet: #. :mod:`xchainpy2_wallet` - Cross-chain wallet combines multiple clients from the list above into a single object. .. toctree:: :maxdepth: 2 :caption: Contents: self install.rst packages/xchainpy2_utils.rst packages/xchainpy2_crypto.rst packages/xchainpy2_thorchain.rst packages/xchainpy2_thorchain_query.rst packages/xchainpy2_thorchain_amm.rst packages/xchainpy2_mayachain.rst packages/xchainpy2_wallet.rst packages/xchainpy2_thornode.rst packages/xchainpy2_mayanode.rst packages/xchainpy2_ethereum.rst packages/xchainpy2_arbitrum.rst packages/xchainpy2_avalanche.rst packages/xchainpy2_bsc.rst packages/xchainpy2_base.rst packages/xchainpy2_bitcoin.rst packages/xchainpy2_litecoin.rst packages/xchainpy2_dogecoin.rst packages/xchainpy2_bitcoincash.rst packages/xchainpy2_cosmos.rst packages/xchainpy2_midgard.rst dev/index.rst