Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

nerdify/infura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slim and Simple infura.io client.

Installing

$ composer require nerdify/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:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. 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

About

Slim and Simple infura.io client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages