laravel-ethereum
laravel-ethereum copied to clipboard
eth_sendtransaction error
$params=array(
'from' =>'0x410a0cbc08011d65b4ab11b2199534e86a1131fa',
'to' =>'0xabe713314023f63b690c02737f079fb0f74a1741',
"gas" => "0x76c0", // 30400
"gasPrice" => "0x9184e72a000", // 10000000000000
'value' =>'0x9184e72a',
'data' =>'0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675'
);
Ethereum::eth_sendTransaction($params);
i get eror message like:
throw new ErrorException('Transaction object expected');
what am i wrong?
hi @halilulker, that function expects an EthereumTransaction
class, your code should be like this.
$from = '0x410a0cbc08011d65b4ab11b2199534e86a1131fa';
$to = '0xabe713314023f63b690c02737f079fb0f74a1741';
$gas = '0x76c0';
$gasPrice = '0x9184e72a000';
$value = '0x9184e72a';
$data = '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675';
$transaction = new EthereumTransaction($from, $to, $value, $gas, $gasPrice, $data);
return Ethereum::eth_sendTransaction($transaction);
Hope that helped.
Kind regards.
thank you @amandiobm but i get this error now:
Class 'EthereumTransaction' not found
@halilulker did you imported?! After your namespace has those two lines?
use Jcsofts\LaravelEthereum\Facade\Ethereum;
use Jcsofts\LaravelEthereum\Lib\EthereumTransaction;
Just to ensure, my composer.json has this "jcsofts/laravel-ethereum": "dev-master"
as the version installed.
Hi there i am getting this error can you help while using the send Transaction Only support send transaction with ipc
How to generate $data value?
$from = '0x410a0cbc08011d65b4ab11b2199534e86a1131fa'; $to = '0xabe713314023f63b690c02737f079fb0f74a1741'; $gas = '0x76c0'; $gasPrice = '0x9184e72a000'; $value = '0x9184e72a'; $data = '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675';
$transaction = new EthereumTransaction($from, $to, $value, $gas, $gasPrice, $data); return Ethereum::eth_sendTransaction($transaction);