Skip to main content

Python core for TON Blockchain — primitives, data types, and utilities.

Project description

📦 TON Core

TON Python Versions PyPI License Donate

Image

Downloads Downloads Downloads

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

ton_core-0.3.4.tar.gz (78.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ton_core-0.3.4-py3-none-any.whl (100.6 kB view details)

Uploaded Python 3

File details

Details for the file ton_core-0.3.4.tar.gz.

File metadata

  • Download URL: ton_core-0.3.4.tar.gz
  • Upload date:
  • Size: 78.1 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

Hashes for ton_core-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c0dd2fb0094fb52386f00bb1e8456f33d5dade4a65cdb2e4dde1adf37b579b0f
MD5 a9f8275f2dd915fe78fbf4bdb148161f
BLAKE2b-256 ef638f4956bd7b4791fbc57c40e1a78d13cccc53e2958d568726dc87c01d0a7a

See more details on using hashes here.

File details

Details for the file ton_core-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: ton_core-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 100.6 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

Hashes for ton_core-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 da460b6349a596a3c838768370424a8c4e58c8668efd9d153213f7babaa3f9bf
MD5 0608d0439bc6b2212d18e74e2235cff9
BLAKE2b-256 e5931ec676134899c4a77fb8655a015ecbb1ecbb6cbbaf3950f615edbb690690

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page