Pytoniq Core
raw JSON → 0.1.46 verified Fri May 01 auth: no python
Core data structures and serialization for the TON Blockchain SDK. Currently at version 0.1.46, released under MIT license. Active development with frequent releases.
pip install pytoniq-core Common errors
error ModuleNotFoundError: No module named 'pytoniq' ↓
cause Old import path for core types. pytoniq-core now lives in pytoniq_core package.
fix
Install pytoniq-core and use
from pytoniq_core import ... error TypeError: store_uint() missing 1 required positional argument: 'bit_len' ↓
cause store_uint requires two arguments: value and bit_length.
fix
Call as
builder.store_uint(value, bit_length) Warnings
breaking Module renamed from 'pytoniq' to 'pytoniq_core'. All imports must use the new underscore name. ↓
fix Change imports: e.g. `from pytoniq_core import Cell` instead of `from pytoniq.cell import Cell`.
gotcha Cell builder methods like store_uint expect (value, bit_length) not just value. Common mistake: store_uint(42) without bits raises TypeError. ↓
fix Always provide bit length: `builder.store_uint(42, 8)`.
deprecated Old TON SDK function 'run_get_method' renamed to 'run_get_method_remote' in pytoniq v0.1.35. pytoniq-core itself is not affected but breaking change in sibling library. ↓
fix Use `run_get_method_remote` in pytoniq if you rely on remote execution.
Imports
- Cell wrong
from pytoniq.cell import Cellcorrectfrom pytoniq_core import Cell - Address wrong
from pytoniq.address import Addresscorrectfrom pytoniq_core import Address - Slice
from pytoniq_core import Slice - begin_cell
from pytoniq_core import begin_cell
Quickstart
from pytoniq_core import Cell, begin_cell, Address
# Build a simple cell
builder = begin_cell()
builder.store_uint(42, 8)
cell = builder.end_cell()
print(cell.hash.hex())