Files
cycle_api/sdk/Wallet/UsdtTrc20.php
2024-03-25 06:15:36 +08:00

33 lines
767 B
PHP

<?php
namespace Sdk\Wallet;
use App\Exceptions\WalletSdkException;
use GuzzleHttp\Client;
class UsdtTrc20
{
const RPC_URL = 'https://api.trongrid.io';
const CONTRACT_ADDRESS = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t';
const API_SECRET = 'b484f01e-d21d-449d-8d3a-df2646536486';
protected Trc20Sdk $sdk;
public function __construct()
{
$headers = [
'TRON-PRO-API-KEY' => self::API_SECRET,
'Content-Type' => 'application/json',
];
$client = new Client(['base_uri' => self::RPC_URL, 'headers' => $headers]);
$trc20Wallet = new Trc20Sdk($client, self::CONTRACT_ADDRESS);
$this->sdk = $trc20Wallet;
}
function getHandler(): Trc20Sdk
{
return $this->sdk;
}
}