Skip to content

harryqt/trongrid-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trongrid PHP SDK built using Saloon.

Install

composer require harryqt/trongrid-php-sdk

Usage

use Harryqt\Trongrid\Connector;
use Harryqt\Trongrid\Requests\GetContractTransactionInfoByAccountAddressRequest;

$connector = new Connector('token');
$response = $connector->send(new GetContractTransactionInfoByAccountAddressRequest);

dd($response->body());

Hyperf

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()));
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages