We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing the send transaction function on
/vendor/web3p/web3.php/examples/sendTransaction.php
require('./exampleBase.php'); $eth = $web3->eth; echo 'Eth Send Transaction' . PHP_EOL; $eth->accounts(function ($err, $accounts) use ($eth) { if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } $fromAccount = $accounts[0]; $toAccount = $accounts[1];
this works, this also proves that the addresses being used are definitely onchain and contain balances
$eth->getBalance($fromAccount, function ($err, $balance) use($fromAccount) { if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } echo $fromAccount . ' Balance: ' . $balance . PHP_EOL; }); $eth->getBalance($toAccount, function ($err, $balance) use($toAccount) { if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } echo $toAccount . ' Balance: ' . $balance . PHP_EOL; });
/end this works
// send transaction $eth->sendTransaction([ 'from' => $fromAccount, 'to' => $toAccount, 'value' => '0x11' ], function ($err, $transaction) use ($eth, $fromAccount, $toAccount) {
the below triggers the error "unknown account", yet the above balance requests work as intended
if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } echo 'Tx hash: ' . $transaction . PHP_EOL;
/end error
// get balance $eth->getBalance($fromAccount, function ($err, $balance) use($fromAccount) { if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } echo $fromAccount . ' Balance: ' . $balance . PHP_EOL; }); $eth->getBalance($toAccount, function ($err, $balance) use($toAccount) { if ($err !== null) { echo 'Error: ' . $err->getMessage(); return; } echo $toAccount . ' Balance: ' . $balance . PHP_EOL; }); }); });
Would appreciate any help
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Testing the send transaction function on
/vendor/web3p/web3.php/examples/sendTransaction.php
this works, this also proves that the addresses being used are definitely onchain and contain balances
/end this works
the below triggers the error "unknown account", yet the above balance requests work as intended
/end error
Would appreciate any help
The text was updated successfully, but these errors were encountered: