Why there is no private key in sending transaction code in Web3.php?

78 Views Asked by At

I want to use Web3.php so that I send contract transaction to Ethereum blockchain.

I use the following code:

$web3 = new Web3('... node address ...');
$contract = new Contract($web3->provider, $contractAbi);
$contract->at($contractAddress)->send($methodName, $param1, $param2, 
    function($err, $result) {
        ...
    });

It produces this error:

Uncaught RuntimeException: Wrong type of eth_sendTransaction method argument 0.

Now my main question is that where my private key must be provided in the code to sign the sent transaction.

0

There are 0 best solutions below