Metadata-Version: 2.1
Name: defichain
Version: 0.0.8
Summary: Defichain Python Library
Home-page: https://github.com/eric-volz/DefichainPython
Author: Intr0c
Author-email: introc@volz.link
License: UNKNOWN
Keywords: python,defichain,node,ocean
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests

[![Downloads](https://static.pepy.tech/personalized-badge/defichain?period=total&units=international_system&left_color=blue&right_color=green&left_text=Downloads)](https://pepy.tech/project/defichain)

# [DefichainPython](https://github.com/eric-volz/DefichainPython)

## This library is not finished yet and therefore should not be used in production!
## Changes can still occur at any time and may break your code!

## Welcome to Defichain's Python Library
___
Welcome to the Python Library for the Defichain! 

In this library all RPC commands of a [Defichain Node](https://defichain.com/downloads) are available and can be 
called in a few lines of code!

If you just want to query data from the blockchain you can also use the Ocean API: you don't need a Defichain Node for 
this, just an internet connection!

But first we need to install it:

### Installation
```bash
pip install defichain
```

### Example Code for RPC
```python
from defichain import Node

node = Node("user", "password", "127.0.0.1", 8554)

node.blockchain.getblockcount() #  returns block height of the latest block

node.poolpair.compositeswap("fromAddress", "BTC", 0.01, "toAddress", "DFI")  # swaps 0.01 BTC to DFI
```

### Example Code for Ocean API
```python
from defichain import Ocean

ocean = Ocean() #  creates the connection to Ocean

ocean.blocks.list() #  returns the latest 30 blocks 

ocean.poolpairs.get(4) #  returns data from ETH-DFI Pool
```

## Next Steps
- Finish the RPC Code
- Write unit tests for RPC and Ocean commands
- Document all functions and publish it on [ReadTheDocs](https://readthedocs.org/)

## Community
This [project](https://github.com/DeFiCh/dfips/issues/133) is funded by the Defichain Community:
Thank you for your trust! If you have suggestions for improvement
or other ideas open an [issue](https://github.com/eric-volz/DefichainPython/issues), 
write me on [Twitter](https://twitter.com/Intr0c) or via email (introc@volz.link)!

## License & Disclaimer
By using (this repo), you (the user) agree to be bound by the 
[terms of this license](https://github.com/eric-volz/defichainLibrary/blob/main/LICENSE) (MIT License).

