bdk-ffi/bdk-python/setup.py

66 lines
1.8 KiB
Python
Raw Normal View History

2021-12-07 10:25:42 -05:00
#!/usr/bin/env python
from setuptools import setup
2021-12-07 10:25:42 -05:00
LONG_DESCRIPTION = """# bdkpython
2022-06-23 15:21:48 -04:00
The Python language bindings for the [Bitcoin Dev Kit](https://github.com/bitcoindevkit).
## Install the package
```shell
pip install bdkpython
```
## Simple example
```python
import bdkpython as bdk
descriptor = bdk.Descriptor("wpkh(tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy/84h/0h/0h/0/*)", bdk.Network.TESTNET)
2022-05-11 16:02:49 -04:00
db_config = bdk.DatabaseConfig.MEMORY()
blockchain_config = bdk.BlockchainConfig.ELECTRUM(
bdk.ElectrumConfig(
"ssl://electrum.blockstream.info:60002",
None,
5,
None,
100,
True,
2022-05-11 16:02:49 -04:00
)
)
blockchain = bdk.Blockchain(blockchain_config)
wallet = bdk.Wallet(
descriptor=descriptor,
2022-05-11 16:02:49 -04:00
change_descriptor=None,
network=bdk.Network.TESTNET,
2022-05-11 16:02:49 -04:00
database_config=db_config,
)
# print new receive address
address_info = wallet.get_address(bdk.AddressIndex.LAST_UNUSED())
2022-06-23 15:21:48 -04:00
address = address_info.address
index = address_info.index
print(f"New BIP84 testnet address: {address} at index {index}")
# print wallet balance
2022-05-11 16:02:49 -04:00
wallet.sync(blockchain, None)
balance = wallet.get_balance()
2022-09-22 11:18:35 -04:00
print(f"Wallet balance is: {balance.total}")
"""
2021-12-07 10:25:42 -05:00
setup(
name="bdkpython",
version="0.28.0.dev0",
2022-08-05 10:31:24 -04:00
description="The Python language bindings for the Bitcoin Development Kit",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
include_package_data = True,
zip_safe=False,
packages=["bdkpython"],
package_dir={"bdkpython": "./src/bdkpython"},
url="https://github.com/bitcoindevkit/bdk-ffi",
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
license="MIT or Apache 2.0",
2021-12-07 10:25:42 -05:00
)