Metadata-Version: 2.4
Name: ton-core
Version: 0.3.5
Summary: Python core for TON Blockchain — primitives, data types, and utilities.
Author: nessshon
Maintainer: nessshon
License-Expression: MIT
Project-URL: Homepage, https://github.com/nessshon/ton-core/
Project-URL: Based on, https://github.com/yungwine/pytoniq-core
Keywords: TON,TON blockchain,The Open Network,blockchain,crypto,smart contracts
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytoniq-core~=0.1.46
Dynamic: license-file

# 📦 TON Core

[![TON](https://img.shields.io/badge/TON-grey?logo=TON&logoColor=40AEF0)](https://ton.org)
![Python Versions](https://img.shields.io/badge/Python-3.10%20--%203.14-black?color=FFE873&labelColor=3776AB)
[![PyPI](https://img.shields.io/pypi/v/ton-core.svg)](https://pypi.python.org/pypi/ton-core)
[![License](https://img.shields.io/github/license/nessshon/ton-core)](https://github.com/nessshon/ton-core/blob/main/LICENSE)
[![Donate](https://img.shields.io/badge/Donate-TON-blue)](https://tonviewer.com/UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness)

![Image](https://raw.githubusercontent.com/nessshon/ton-core/main/assets/banner.png)

![Downloads](https://pepy.tech/badge/ton-core)
![Downloads](https://pepy.tech/badge/ton-core/month)
![Downloads](https://pepy.tech/badge/ton-core/week)

### Python core for [TON Blockchain](https://ton.org)

Primitives, data types, TLB schemas, contract tools, and crypto utilities for TON.

> Based on [pytoniq-core](https://github.com/yungwine/pytoniq-core) by [Maksim Kurbatov](https://github.com/yungwine)

**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

```bash
pip install ton-core
```

## Usage

```python
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](https://github.com/yungwine/pytoniq-core/tree/master/examples).

## License

This repository is distributed under the [MIT License](https://github.com/nessshon/ton-core/blob/main/LICENSE).
