claushellsing / infura
Slim and Simple infura.io client
dev-master
2020-01-30 07:17 UTC
Requires
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2025-07-29 02:16:24 UTC
README
Slim and Simple infura.io client.
Installing
$ composer require claushellsing/infura
Usage
<?php /** * Infura constructor. * * @param string $network Ethereum network 'rinkenby', 'ropsten', 'mainnet', etc * @param string $projectId Your Infura project 'PROJECT ID' */ $client = new Infura($network, $projectId);
To invoke infura.io methods just call the method
example:
$client->eth_blockNumber();
return
[ "jsonrpc" => "2.0", "id" => 1, "result" => "0x65a8db", ];
example:
$client->eth_getBlockTransactionCountByHash("0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35");
return
[ "jsonrpc" => "2.0", "id" => 1, "result" => "0x50", ];
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT