Skip to main content

Setup

Either import chain_bitcoin

import chain_bitcoin

address_info = chain_bitcoin.get_address(
    some_address_hash, api_key_id=some_api_key_id)

or configure a Chain object

from chain_bitcoin import Chain

chain = Chain(api_key_id=some_api_key_id)
address_info = chain.get_address(some_address_hash)

Function examples

from chain_bitcoin import Chain

chain = Chain(api_key_id='...', api_key_secret='...')

chain.get_address('17x23dNjXJLzGMev6R63uyRhMWP1VHawKc')

chain.get_addresses(['1K4nPxBMy6sv7jssTvDLJWk1ADHBZEoUVb',
                     '1EX1E9n3bPA1zGKDV5iHY2MnM7n5tDfnfH'])

chain.get_address_transactions('17x23dNjXJLzGMev6R63uyRhMWP1VHawKc')

chain.get_addresses_transactions(['1K4nPxBMy6sv7jssTvDLJWk1ADHBZEoUVb',
                                  '1EX1E9n3bPA1zGKDV5iHY2MnM7n5tDfnfH'])

chain.get_address_unspents('17x23dNjXJLzGMev6R63uyRhMWP1VHawKc')

chain.get_addresses_unspents(['1K4nPxBMy6sv7jssTvDLJWk1ADHBZEoUVb',
                              '1EX1E9n3bPA1zGKDV5iHY2MnM7n5tDfnfH'])

chain.get_address_op_returns('1Bj5UVzWQ84iBCUiy5eQ1NEfWfJ4a3yKG1')

chain.get_transaction(
    '0f40015ddbb8a05e26bbacfb70b6074daa1990b813ba9bc70b7ac5b0b6ee2c45')

chain.get_transaction_op_return(
    '4a7d62a4a5cc912605c46c6a6ef6c4af451255a453e6cbf2b1022766c331f803')

chain.get_block_by_hash(
    '00000000000000009cc33fe219537756a68ee5433d593034b6dc200b34aa35fa')

chain.get_block_by_height(308920)

chain.get_latest_block()

chain.get_block_op_returns_by_hash(
    '00000000000000009cc33fe219537756a68ee5433d593034b6dc200b34aa35fa')

chain.get_block_op_returns_by_height(308920)

chain.create_webhook(
    webhook_id='test_webhook',
    webhook_url='https://example.com/chain')

chain.list_webhooks()

chain.update_webhook(
    webhook_id='test_webhook',
    webhook_url='https://example.com/chain2')

chain.create_address_transaction_event(
    webhook_id='test_webhook',
    address='17x23dNjXJLzGMev6R63uyRhMWP1VHawKc',
    confirmations=2)

chain.list_webhook_events('test_webhook')

chain.delete_address_transaction_event(
    webhook_id='test_webhook',
    address='17x23dNjXJLzGMev6R63uyRhMWP1VHawKc')

chain.delete_webhook('test_webhook')

Webhook-parsing example

from chain_bitcoin import WebhookEvent
import json

message = WebhookEvent.Message.from_dict(json.loads(request.body))

Changes

0.4

Type of time attributes: string -> datetime (#2)

Type of bitcoin amount attributes: int -> Btc (#3)

0.3

Initial release

< 0.3

Defunct

Metadata

Release files for chain_bitcoin 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chain_bitcoin 0.4
File Size Uploaded Provenance Actions
chain_bitcoin-0.4.tar.gz 12.9 kB Without provenance Details for chain_bitcoin-0.4.tar.gz

Release files / chain_bitcoin-0.4.tar.gz

Download URL chain_bitcoin-0.4.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
394e34d22109de739e494aca445ef1d709f9acbf99d66bcb2bf67f51c8c1bb14
BLAKE2b-256 checksum
How to use checksums
2bce65c07d1671de10e20cdfe0339ffe026d0c5346a0e70866a949d52ce398f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for chain_bitcoin 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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