Skip to main content

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
    >>> node_url = os.getenv("ROPSTEN_URL")
    >>> private_key = os.getenv("TBTC_PRIVATE_KEY")
    >>> w3 = init_web3(node_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])
    

    Example txn created the deposit contract

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

    Example txn retrieved the address: tb1q38yzl97hg0vnn4wf7srguwjnmlgfa30uq3nrwt

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/

Metadata

Release files for tbtc 0.0.5

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

Source distribution (sdist)

Source distribution for tbtc 0.0.5
File Size Uploaded Provenance
tbtc-0.0.5.tar.gz 9.2 kB Without provenance Details

Release files / tbtc-0.0.5.tar.gz

Download URL tbtc-0.0.5.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8e8d52021380aad6ee1bc05ab1cebae30cc9c6f5c06e9fc35155451ffa6d8170
BLAKE2b-256 checksum
How to use checksums
c3f731a8a2ffbc16d8931b785bc16fc2f3de838208aecfbd0eb9340f5ef2747b
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for tbtc 0.0.5

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