Download the PHP package amashukov/toncenter-client-php without Composer

On this page you can find all versions of the php package amashukov/toncenter-client-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 toncenter-client-php

amashukov/toncenter-client-php

Typed PHP toncenter v2 client for The Open Network — PSR-18 transport, {ok, result} envelope unwrapping, retry-aware, typed Value Objects.

CI PHPStan L9 Latest Version Downloads PHP Stars

A typed PHP client for the toncenter v2 HTTP API on The Open Network (TON). It speaks any PSR-18 HTTP client, unwraps the {ok, result} envelope into typed exceptions in one place, and returns Value Objects instead of loose arrays — masterchain info, account state, a run-get-method stack reader, and typed transactions. TON balances exceed PHP_INT_MAX past ~9,223 TON, so every nano-TON value comes back as a decimal string, never a lossy float. Includes ToncenterWalletRpc, a drop-in WalletRpcInterface adapter for ton-wallet-php.

Features

Why amashukov/toncenter-client-php

The common alternative is hand-rolled Guzzle calls scattered across a service layer, each re-implementing envelope checks, bigint parsing, and 542/429 retry logic. This package centralizes all of that behind a typed surface with PHPStan level 9, returns Value Objects instead of arrays, and stays transport-agnostic so retry / API-key concerns live in your PSR-18 pipeline.

Installation

Usage

Any PSR-18 client and PSR-17 factory pair works. The example below wires amashukov/http-client-php (cURL transport + retry / header-injection middleware) with nyholm/psr7 for the PSR-7 messages:

Reading get-method results

The stack reader is a cursor over a TON TupleItem sum-type (TonTupleItemInt / Cell / Slice / Builder / Null / Tuple) and decodes both decimal and 0x-prefixed bigints via GMP.

Broadcasting a wallet transfer

API

Method Returns
getMasterchainInfo() TonMasterchainInfo
getBalance(string $address) string (decimal nano-TON)
getAddressInformation(string $address) TonAccountInfo
isContractDeployed(string $address) bool
getTypedTransactions(string $address, array $opts = []) list<TonTransaction>
getTypedTransaction(string $address, string $lt, string $hash) TonTransaction
runMethod(string $address, string $method, array $stack = []) TonRunMethodResult
sendBoc(string $bocBase64) TonSendBocResult

Requirements

Related packages

Package Role
amashukov/ton-wallet-php Wallet v4r2 + WalletRpcInterface this client adapts (dependency)
amashukov/http-client-php PSR-18 cURL client + retry / header-injection middleware
amashukov/ton-cell-php TLB Cell / Builder / BOC layer
amashukov/ton-php TON meta-package
amashukov/blockchain-context-bundle Symfony bundle wiring the whole family

Quality

License

MIT — see LICENSE.


All versions of toncenter-client-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-gmp Version *
amashukov/ton-wallet-php Version ^0.1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
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/toncenter-client-php contains the following files

Loading the files please wait ...