Python core for TON Blockchain
Primitives, data types, TLB schemas, contract tools, and crypto utilities for TON.
Based on pytoniq-core by Maksim Kurbatov
Features
- Primitives — core data types for cells, addresses, slices, and hash maps
- TLB Schemas — transactions, blocks, accounts, and config parameters
- Contracts — wallets, jettons, NFTs, DNS, and Telegram
- Crypto — mnemonics, keys, signing, and encryption
- Utilities — conversion, encoding, and helpers
pip install ton-corefrom ton_core import Address, begin_cell, cell_to_b64, to_nano
# Parse a TON address
destination = Address("UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness")
# Convert TON to nanotons
amount = to_nano("0.5")
# Build a message body
body = begin_cell()
body.store_uint(0, 32)
body.store_string("Hello from ton-core!")
cell = body.end_cell()
# Serialize to base64
payload = cell_to_b64(cell)More examples available in pytoniq-core/examples.
This repository is distributed under the MIT License.
