Trongrid PHP SDK built using Saloon.
composer require harryqt/trongrid-php-sdk
use Harryqt\Trongrid\Connector;
use Harryqt\Trongrid\Requests\GetContractTransactionInfoByAccountAddressRequest;
$connector = new Connector('token');
$response = $connector->send(new GetContractTransactionInfoByAccountAddressRequest);
dd($response->body());
Use HyperfConnector
for coroutineization of the HTTP client when using on Hyperf framework.
use GuzzleHttp\HandlerStack;
use Hyperf\Guzzle\CoroutineHandler;
use Harryqt\Trongrid\Connector;
use Saloon\Http\Senders\GuzzleSender;
class HyperfConnector extends Connector
{
public function __construct(public readonly string $token)
{
/** @var GuzzleSender $sender */
$sender = $this->sender();
$sender->setHandlerStack(HandlerStack::create(new CoroutineHandler()));
}
}