{"id":37066707,"url":"https://github.com/yurzs/ton-connect","last_synced_at":"2026-01-14T07:49:46.389Z","repository":{"id":269305206,"uuid":"906997195","full_name":"Yurzs/ton-connect","owner":"Yurzs","description":"Python SDK for TON Connect","archived":false,"fork":false,"pushed_at":"2025-06-06T18:49:53.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T22:39:43.280Z","etag":null,"topics":["python","telegram","ton","ton-connect","ton-connect-sdk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yurzs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-22T14:26:57.000Z","updated_at":"2025-06-06T18:49:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"a19b11e8-5f16-48ac-bcf9-fb2b6343fd93","html_url":"https://github.com/Yurzs/ton-connect","commit_stats":null,"previous_names":["yurzs/ton-connect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yurzs/ton-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yurzs%2Fton-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yurzs%2Fton-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yurzs%2Fton-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yurzs%2Fton-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yurzs","download_url":"https://codeload.github.com/Yurzs/ton-connect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yurzs%2Fton-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","telegram","ton","ton-connect","ton-connect-sdk"],"created_at":"2026-01-14T07:49:45.694Z","updated_at":"2026-01-14T07:49:46.372Z","avatar_url":"https://github.com/Yurzs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TonConnect\n\nTonConnect is a Python library that allows you to connect to TON wallets, manage connections, handle messages, and send requests to the wallet. It provides a convenient way to interact with TON wallets and perform various operations.\n\n## Installation\n\nTo install TonConnect, you can use pip:\n\n```bash\npip install ton-connect\n```\n\n## Usage\n\n### TonConnect Class\n\nThe `TonConnect` class is responsible for managing connections to TON wallets. It provides methods to connect to a wallet, restore a connection, handle messages, start and stop listeners, and send requests to the wallet.\n\n### Initializing TonConnect\n\nTo initialize the `TonConnect` class, you need to provide the manifest URL and a storage instance. The manifest URL is the URL to the manifest file of your app, and the storage instance is used to store connection data. Note that the first argument to `DictBridgeStorage` is the user id.\n\n```python\nfrom ton_connect.connector import TonConnect\nfrom ton_connect.storage import DictBridgeStorage\n\n\nmanifest_url = \"https://example.com/manifest.json\"\nstorage = DictBridgeStorage(\"user_id\")\n\nton_connect = TonConnect(manifest_url, storage)\n```\n\n### Connecting to a Wallet\n\nTo connect to a wallet, you need to provide a `WalletApp` instance. The `WalletApp` class represents a wallet app and contains information such as the app name, bridge URL, and universal URL.\n\nYou can also use the `TonConnect.get_wallets` method to get a list of supported wallet apps.\n\n```python\nfrom ton_connect.model.app.wallet import WalletApp\nfrom ton_connect.connector import TonConnect\n\nwallets = await TonConnect.get_wallets()\nwallet = wallets[0]\n\nconnect_url = await ton_connect.connect(wallet)\nprint(\"Connect URL:\", connect_url)\n```\n\n### Restoring a Connection\n\nTo restore a connection to a wallet, you can use the `restore_connection` method. This method restores the connection using the stored connection data.\n\n```python\nawait ton_connect.restore_connection(wallet)\n```\n\n### Sending Requests\n\nThe `TonConnect` class provides methods to send various requests to the wallet. For example, you can send a transaction request using the `SendTransactionRequest` class.\n\n```python\nfrom ton_connect.model.app.request import SendTransactionRequest, SendTransactionMessage\n\nrequest = SendTransactionRequest(\n    address=\"0:1234567890abcdef\",\n    network=1,\n    messages=[\n        SendTransactionMessage(\n            address=\"0:abcdef1234567890\",\n            amount=\"1000000000\"\n        )\n    ]\n)\n\nresponse = await ton_connect.send(wallet.app_name, request)\nprint(\"Response:\", response)\n```\n\n### Listening for Wallet Events\n\nThe `TonConnect` class allows you to listen for wallet events by adding event listeners. You can add event listeners for events such as connect, disconnect, and errors.\n\n```python\nfrom ton_connect.model.wallet.event import WalletEventName\nfrom ton_connect.connector import ConnectorEvent\n\nasync def on_connect(event: ConnectorEvent):\n    print(\"Connected:\", event)\n\nasync def on_disconnect(event: ConnectorEvent):\n    print(\"Disconnected:\", event)\n\nton_connect.listen(WalletEventName.CONNECT, on_connect)\nton_connect.listen(WalletEventName.DISCONNECT, on_disconnect)\n```\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurzs%2Fton-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyurzs%2Fton-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurzs%2Fton-connect/lists"}