Skip to main content

A python library to interact with the tbtc protocol.

Project description

A python client to interact with the tbtc protocol.

tBTC Protocol version: 1.1.0


  1. Create & activate virtulenv (python 3.6+)

  2. Install the library using pypi.

    pip install tbtc


  1. Initialize the tbtc system

    >>> from tbtc.session import init_web3
    >>> w3 = init_web3(infura_url)
    >>> version = "1.1.0"
    >>> t = TBTC(version, w3, 'testnet', private_key)
  2. Get lot sizes

    >>> lot_sizes = t.get_available_lot_sizes()
  3. Create a deposit contract

    >>> logs = t.create_deposit(lot_sizes[0])
  4. Get the bitcoin address for depositing BTC

    >>> d = Deposit(
    ... t, 
    ... logs[0]['args']['_depositContractAddress'],
    ... logs[0]['args']['_keepAddress']
    ... )
    >>> address = d.get_signer_public_key()


  1. Clone & enter the repo. git clone
  2. Install required libraries. pip install -r requirements.txt


  1. Run the tests locally

    pytest -vv tests/

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tbtc-0.0.4.tar.gz (8.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page