I have a function written in PHP that do transfer from one wallet to another through web3p, web3.php and moralis speedy node.
$web3 = new \Web3\Web3(new \Web3\Providers\HttpProvider(new \Web3\RequestManagers\HttpRequestManager('https://speedy-nodes-nyc.moralis.io/xxxxxxxxx/bsc/mainnet', 2)));
$eth = $web3->eth;
$transactionParams['gasPrice'] = '0x' . dechex($gasPriceMultiplied);
$transactionParams['chainId'] = $chainId;
$tx = new \Web3p\EthereumTx\Transaction($transactionParams);
$signedTx = '0x' . $tx->sign($fromAddrPrivateKey);
try {
$eth->sendRawTransaction($signedTx, function ($err, $txResult) use (&$rst) {
if($err) {
$rst = array(
'errCode' => 1,
'errMsg' => $err->getMessage()
);
} else {
$rst = array(
'errCode' => 0,
'errMsg' => '',
'txHash' => $txResult
);
}
});
}
I received an announcement email from Moralis saying that speedy node will be discontinued on 11 Jul 2022 and recommend to replace it with WEB3API.
I understand that web3api has runContractFunction function to call contract “transfer” function, but so far I think it’s only for readonly function. anyone has a solution if I want to make a call to transfer function in my contract?