Download the PHP package amashukov/ton-cell-php without Composer

On this page you can find all versions of the php package amashukov/ton-cell-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ton-cell-php

amashukov/ton-cell-php

Pure-PHP TLB Cell, Builder, Slice and canonical BOC encoder for The Open Network (TON) — byte-for-byte parity with @ton/core.

CI PHPStan L9 Latest Version Downloads PHP Stars

amashukov/ton-cell-php implements the TLB (Type Language - Binary) cell layer for The Open Network (TON) in pure PHP: Cell, Builder, Slice, and a canonical BOC (Bag of Cells) serializer. It is a byte-exact equivalent of the @ton/core cell layer used across TON SDKs, suitable for building and parsing jetton transfers, contract messages and any TLB-encoded payload from PHP.

Features

Why amashukov/ton-cell-php

TON SDKs are written in TypeScript (@ton/core) and a PHP project either shells out to Node or reimplements the cell layer ad hoc. amashukov/ton-cell-php gives you the cell / BOC primitives natively in PHP with byte-for-byte parity against @ton/core v15, so a BOC built in PHP is wire-identical to one built by the canonical SDK — no Node sidecar, no FFI.

Installation

Usage

Build a cell

Builder exposes storeBit, storeUint(int|string $value, int $bits), storeInt, storeCoins, storeBits, storeBuffer, storeAddress, storeRef, storeStringTail, storeStringRefTail, storeBuilder, storeCellInline. Bigint values cross PHP_INT_MAX safely via ext-gmp (decimal-string in, decimal-string out).

Parse a cell

Slice exposes loadBit, loadUint, loadUintString, loadCoins, loadAddress, loadBits, loadRef, loadStringTail, loadStringRefTail, remainingBits, remainingRefs. Anycast and non-addr_std$10 shapes are rejected with RuntimeException.

Compute the cell hash

Used for Ed25519 message signing and TON address derivation. Memoised across calls.

Serialise to BOC

The BOC encoder emits @ton/core v15's canonical format (has_crc32c=1, little-endian CRC32C tail) and auto-promotes offset_byte_size from 1 to 2 when total cell-data size exceeds 255 bytes. Hard cap is 65 535 bytes per BOC; extend the encoder, not the rule.

AddressData value object

AddressData is a minimal wc + hashPart carrier — just enough for the cell layer to serialise the addr_std$10 TLB shape. Full address parsing (user-friendly EQ… / UQ… base64 forms, CRC-16 checksum, testnet flag) belongs to a downstream wallet package and lives on top of this VO.

BitReader

Bit-level reader over a binary string with a known precise bit length — useful for parsing TLB fields that aren't byte-aligned (for example, contract-emitted event payloads). readUint(bits) and readInt(bits) cover [0, 32] with strict overrun + range guards.

Requirements

No composer dependencies.

Related packages

Part of a modular pure-PHP blockchain toolkit:

Package Purpose
amashukov/ton-cell-php TON TLB Cell / Builder / Slice / BOC
amashukov/ton-crypto-php TON Ed25519 / mnemonic crypto
amashukov/ton-wallet-php TON wallet contract tooling
amashukov/toncenter-client-php toncenter JSON-RPC client
amashukov/ton-php TON umbrella package
amashukov/keccak-php Keccak-256 / SHA-3 / SHAKE hashing
amashukov/secp256k1-php secp256k1 ECDSA sign / verify / recover
amashukov/rlp-php Ethereum RLP encode / decode

Quality

Reference

License

MIT License.


All versions of ton-cell-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-gmp Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amashukov/ton-cell-php contains the following files

Loading the files please wait ...