TON Connect - Python library for using TON Connect 2.
Project description
TON Connect for Python
Library for connecting TON Connect to Python apps.
Description
At this moment you can connect wallets to apps using HTTP Bridge.
Getting Started
Dependencies
- PyNaCl
- tonsdk (will be removed in the future)
Installing
git clone https://github.com/ClickoTON-Foundation/tonconnect.git
pip install -e tonconnect
Using
Example of connecting wallet.
from tonconnect.connector import Connector
connector = Connector('https://tonclick.online/ton-connect.json')
url = connector.connect('tonkeeper', 'test')
print(f'Universal connect url for Tonkeeper: {url}')
address = connector.get_address()
print(f'Successfuly connected {address}.')
Example of asynchronous connecting wallet.
import asyncio
from tonconnect.connector import AsyncConnector
async def main():
connector = AsyncConnector('https://tonclick.online/ton-connect.json')
url = await connector.connect('tonkeeper', 'test')
print(f'Universal connect url for Tonkeeper: {url}')
address = await connector.get_address()
print(f'Successfuly connected {address}.')
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Authors
Version History
- 0.1.0
- Async wrapper
- 0.0.2 & 0.0.3
- pyproject.toml fix
- 0.0.1
- Initial Beta
License
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details
Donate
If you like the library, I will be glad to accept donations.
- TON: EQCgphx8rTI0PukwmgpVqiPgqguTujhQscg2h7jgc4U0t347
Acknowledgments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tonconnect-0.1.0.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for tonconnect-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 119bf926641e9266dd1e2a93311f584b1c4e41e5dd47f0e682c3c0af44a76ea2 |
|
MD5 | 3bbde28794abaa3be443d5cfff326fc7 |
|
BLAKE2b-256 | ac967ddbb24bea1173fd6f78c4e246d481f9e0e2ab4b4a2971086a0cc5f342ea |