MadelineProto/ton
Daniil Gentili 4f69701cfc
Update even more typehints
2020-10-03 15:04:35 +02:00
..
README.md Update README.md 2019-12-23 16:21:52 +01:00
lite-client.php Update even more typehints 2020-10-03 15:04:35 +02:00
ton-lite-client-test1.config.json Performance improvements 2020-02-07 21:13:49 +01:00
toncustom.json Implement 2019-12-16 21:14:57 +01:00

README.md

TON integration

MadelineProto is now capable of integrating with the Telegram TON blockchain, thanks to a fully native implementation of ADNL and the lite-client protocol.

It allows async interaction with liteservers in the same manner as the official lite-client, only with way more abstractions and ease of use.

Please note that the project is in alpha stage.

For a fully separate and standalone pure JS client-side implementation of the TON protocol check out madelineTon.js: interact directly with the TON blockchain with no middlemans, directly from your browser!

Instantiation

use danog\MadelineProto\TON\API;

$API = new API(
    [
        'logger' => [
            'logger' => Logger::ECHO_LOGGER
        ]
    ]
);

Usage

$API->async(true);
$API->loop(
    function () use ($API) {
        yield $API->connect(__DIR__.'/ton-lite-client-test1.config.json');
        var_dump(yield $API->liteServer->getTime());
    }
);

For a full overview of async in MadelineProtoTon, take a look at the MadelineProto async docs.

For a full list of methods that can be used, simply look at the PHPDOC suggestions in your favorite IDE, or take a look at the ---functions--- section of the lite TL scheme.

This API can be used to build web-facing HTTP APIs that query the TON blockchain (using the async http-client), off-chain elements for TON applications and so much more!

For a fully separate and standalone pure JS client-side implementation of the TON protocol check out madelineTon.js: interact directly with the TON blockchain with no middlemans, directly from your browser!