Skip to main content

A python library to interact with the tbtc protocol.

Project description

tBTC.py

A python client to interact with the tbtc protocol.

tBTC Protocol version: 1.1.0

Setup:

  1. Create & activate virtulenv (python 3.6+)

  2. Install the library using pypi.

    pip install tbtc
    

Usage:

  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()
    

Development:

  1. Clone & enter the repo. git clone https://github.com/ankitchiplunkar/tbtc.py.git
  2. Install required libraries. pip install -r requirements.txt

Testing:

  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 details)

Uploaded Source

File details

Details for the file tbtc-0.0.4.tar.gz.

File metadata

  • Download URL: tbtc-0.0.4.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for tbtc-0.0.4.tar.gz
Algorithm Hash digest
SHA256 be4ad823b7aff852c009b8c7e7635c2327e94a4592e4e396c196be6cf3fb33ed
MD5 fd9e1f82071ece1b79fe33f272dddb26
BLAKE2b-256 5cf0fec53dad91843407ab3d9d955a5e3b632c91a95393cec1603cebf25ded40

See more details on using hashes here.

Supported by

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