Checking account balances and sending tokens
In this flow, we are going to describe the process of checking an account balance and sending tokens to a hedera id. There are a number of applications of this including systems for access tokens and
Overview
Check a token balance
Imports
use Trustenterprises\LaravelHashgraph\LaravelHashgraph;
use Trustenterprises\LaravelHashgraph\Models\AccountTokenBalanceResponse;Code
$account_id = '0.0.15657776'; // A venly-created account on testnet
$token_id = '0.0.15657534'; // Token already created
$token_balance = LaravelHashgraph::getTokenBalance($account_id, $token_id);
// Token value in whole numbers, ignoring the "decimals places" of a created token.
$token_balance->getAmount(); Send a token to an account
Imports
Code
Last updated