PHP code example of icekristal / laravel-chain-gateway-api
1. Go to this page and download the library: Download icekristal/laravel-chain-gateway-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
icekristal / laravel-chain-gateway-api example snippets
$result = ChainGateway::subscribeTronAddress(string $addressFrom, string $url); // For trx transactions
$result = ChainGateway::subscribeTRC20Address(string $addressFrom, string $hex); // For trc20 transactions - only version 1
$result = ChainGateway::subscribeBNBAddress(string $addressFrom, string $url); // For bnb transactions
$result = ChainGateway::subscribeBEP20Address(string $addressFrom, string $hex); // For bnb transactions - only version 1
$result = ChainGateway::subscribeTronList(); // Tron
$result = ChainGateway::subscribeBNBList(); // Bnb
$result = ChainGateway::unSubscribeTronAddress(string $addressFrom, string $url); // For trx transactions
$result = ChainGateway::unSubscribeTRC20Address(string $addressFrom, string $url); // For trc20 transactions
$result = ChainGateway::unSubscribeBNBAddress(string $addressFrom, string $url); // For bnb transactions
$result = ChainGateway::unSubscribeBEP20Address(string $addressFrom, string $url); // For bnb transactions
$result = ChainGateway::unSubscribeTronAddress(string $webhookId); // For trx transactions
$result = ChainGateway::unSubscribeBNBAddress(string $webhookId); // For bnb transactions
$result = ChainGateway::getTronTransaction(string $tXId); // get info tron transaction
$result = ChainGateway::getBNBTransaction(string $tXId); // get info bnb transaction
$result = ChainGateway::getBNBBalance(string $address); // get BNB balance
$result = ChainGateway::getBEP20Balance(string $address); // get bep20 balance
$result = ChainGateway::getTronBalance(string $address); // get TRX balance
$result = ChainGateway::getTRC20Balance(string $address); // get trc20 balance
$type = 'trc20'; // variables: trx,bnb,bep20,trc20,trc_20,bep_20
$result = ChainGateway::balance($type, string $address); // get balance for type