Comments (1)
update: i change the code and i'm getting "Call to a member function signTransaction() on bool"
$eth = new Eth($web3->getProvider());
// Create the transaction object
$transaction = [
'from' => $senderAddress,
'to' => $contractAddress,
'data' => $contract->getData($functionName, 5678, $data_bc),
//'data' => '0x'. $contract->getData($functionName, 5678, $data_bc),
// Sign the transaction
$signedTransaction = $eth->accounts->signTransaction($transaction, $privateKey); //FIXME
];
// Send the transaction to the network
$transactionHash = $eth->sendRawTransaction($signedTransaction);
echo 'Transaction Hash: ' . Utils::toString($transactionHash) . PHP_EOL;
// Wait for the transaction to be mined
$receipt = $eth->getTransactionReceipt($transactionHash);
if ($receipt !== null) {
echo 'Transaction Mined' . PHP_EOL;
}
from web3.php.
Related Issues (20)
- Invalid signature v value HOT 1
- PancakeSwap HOT 1
- Contracts/Types/Address.php issue
- Getting Null when i try to call contract function HOT 1
- phpseclib has CVE-2023-49316 HOT 3
- The examples haven't been updated in 5 years HOT 1
- Get "unknown account" when testing the sendTransaction function
- Unallowed rpc method: eth_chainId
- Why there is no private key in sending transaction code in Web3.php? HOT 1
- Error "Undefined array key "coders"" HOT 4
- Error -> rlp: input string too long for common.Address, decoding into (types.LegacyTx).To
- Any documentation with common examples? HOT 2
- Uncaught InvalidArgumentException: Please make sure you have put all function params and callback. HOT 1
- Please set provider first.
- Issue with constructor->send() function
- hope support phpseclib/phpseclib:~3.0 HOT 3
- decodeParameters($types, $param) decode uint256[] Cannot return decimals
- $contract->at($erc20TokenAddress)->call('balanceOf', [$accountAddress], function($err, $result) { } function call with params giving error while function call without params is working HOT 2
- Please make sure you have put all function params and callback.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3.php.