Python core for TON Blockchain — primitives, data types, and utilities.
Project description
📦 TON Core
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
Installation
pip install ton-core
Usage
from 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.
License
This repository is distributed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ton_core-0.3.1.tar.gz.
File metadata
- Download URL: ton_core-0.3.1.tar.gz
- Upload date:
- Size: 77.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8da3de3cda6458e4fcfa444c038397a855b9e689c0c8a9d36fae27b7fa75525b
|
|
| MD5 |
41091f2d09ed8c03d6c8259482e8cfbb
|
|
| BLAKE2b-256 |
3d23196e4e0cde82d5468cdd647cd47dc9941958879ff6ba5c335c8237d13425
|
File details
Details for the file ton_core-0.3.1-py3-none-any.whl.
File metadata
- Download URL: ton_core-0.3.1-py3-none-any.whl
- Upload date:
- Size: 100.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66eae12230aef5f77761620f26b5527d1ed7e9fa91d469b91be841fffb7220e7
|
|
| MD5 |
b61cf07278d22d1ab672a7a129acc92b
|
|
| BLAKE2b-256 |
a78d46180cd03119017d574fa0ef672c5da5bcc099390989971ac32903a3a18d
|