Registry / http-networking / tonsdk

tonsdk

JSON →
library1.0.15pypypi✓ verified 81d ago

Python SDK for interacting with The Open Network (TON) blockchain. Current version 1.0.15 supports wallet operations, message serialization, and contract interactions. Release cadence is irregular.

pip install tonsdk
INSTALL
IMPORT
SIG · TONSDK
T
tonsdk
http-networkingpythonv1.0.15
Install
2.5s avg
Import
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.15 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 26MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TonClient
import tonsdk
from tonsdk import TonClient

Initialize client, create wallet, check balance

from tonsdk.client import TonClient from tonsdk.wallet import Wallet from tonsdk.utils import to_nano # Create a custom client (mainnet by default) client = TonClient(config={'endpoints': ['https://toncenter.com/api/v2/jsonRPC']}) # Generate a new wallet (mnemonic is printed) wallet, mnemonic, private_key, public_key, wallet_type = Wallet.create(mnemonics=24, randomgen=True) print('Mnemonic:', mnemonic) print('Wallet address:', wallet.address.to_string()) # Check balance balance = client.get_balance(wallet.address.to_string()) print('Balance:', balance) # Create a transfer message # message = wallet.create_transfer_message(destination='EQD...', amount=to_nano(0.1)) # result = client.send_boc(message['message'].to_boc()) # print('Transfer sent:', result)
Debug
Known issues
gotchaWallet.create() prints mnemonic to stdout. In production, never log mnemonic; consider using Wallet.from_mnemonic() with a securely stored phrase.
fix
Use Wallet.from_mnemonic(mnemonic=your_list, version='v3r2') to restore wallet.
affects: all
breakingVersion 0.9.x had different import paths; code using `from tonsdk import ...` will fail with 1.0.x.
fix
Update imports to use submodule paths: from tonsdk.client import TonClient, etc.
affects: 0.9.x to 1.0.x
gotchaTonClient.get_balance() returns string (nanoton), not integer. Arithmetic without conversion to int may cause unexpected behavior.
fix
Use int(balance) if needed for math.
affects: all
deprecatedTonClient default endpoint 'https://ton.org/...' may be deprecated; use TonCenter endpoint explicitly.
fix
Set config={'endpoints': ['https://toncenter.com/api/v2/jsonRPC']} when creating client.
affects: 1.0.x
Upgrade
Version history
1.0.15latest on PyPI · released Jul 9, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
41 hits · last 30 days
node
38
OpenAI (training)
1
Resources
tonsdk — pip install tonsdk · libregistry