Metadata-Version: 2.1
Name: bdkpython
Version: 0.2.0
Summary: The Python language bindings for the Bitcoin Development Kit
Home-page: https://github.com/bitcoindevkit/bdk-python
Author: Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>
License: MIT or Apache 2.0
Platform: UNKNOWN
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-APACHE
License-File: LICENSE-MIT

# bdkpython
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 = "wpkh(tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy/84h/0h/0h/0/*)"
db_config = bdk.DatabaseConfig.MEMORY()
blockchain_config = bdk.BlockchainConfig.ELECTRUM(
    bdk.ElectrumConfig(
        "ssl://electrum.blockstream.info:60002",
        None,
        5,
        None,
        100
    )
)
blockchain = bdk.Blockchain(blockchain_config)

wallet = bdk.Wallet(
             descriptor=descriptor,
             change_descriptor=None,
             network=bdk.Network.TESTNET,
             database_config=db_config,
         )

# print new receive address
address_info = wallet.get_address(bdk.AddressIndex.LAST_UNUSED)
address = address_info.address
index = address_info.index
print(f"New BIP84 testnet address: {address} at index {index}")


# print wallet balance
wallet.sync(blockchain, None)
balance = wallet.get_balance()
print(f"Wallet balance is: {balance}")


