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 (HTML docs coming soon).This API can be used to build web-facing HTTP APIs that query the TON blockchain (using the async http-server), off-chain elements for TON applications and so much more!
Since it's in PHP & integrated in MadelineProto, you can also use it in free webhosts (aka use the blockchain on 000webhost AAAAAAAAA ❤️❤️❤️❤️❤️)