web3p / web3.php

A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.
MIT License
1.16k stars 543 forks source link

$eth->accounts function not showing anything #261

Open eracom-tester opened 2 years ago

eracom-tester commented 2 years ago

$eth->accounts(function ($err, $accounts) use ($eth) {

if ($err !== null) {
    echo 'Error: ' . $err->getMessage();
    return;
}
foreach ($accounts as $account) {
    echo 'Account: ' . $account . PHP_EOL;

    $eth->getBalance($account, function ($err, $balance) {
        if ($err !== null) {
            echo 'Error: ' . $err->getMessage();
            return;
        }
        echo 'Balance: ' . $balance . PHP_EOL;
    });
}

});