{"id":13792282,"url":"https://github.com/digitaldonkey/ethereum-php","last_synced_at":"2025-05-14T10:06:19.300Z","repository":{"id":37547220,"uuid":"82977686","full_name":"digitaldonkey/ethereum-php","owner":"digitaldonkey","description":"PHP interface to Ethereum JSON-RPC API. Fully typed Web3 for PHP 7.X","archived":false,"fork":false,"pushed_at":"2024-11-26T08:40:06.000Z","size":2002,"stargazers_count":495,"open_issues_count":27,"forks_count":173,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-13T06:14:55.915Z","etag":null,"topics":["ethereum","ethereum-client","ethereum-php","ethereum-php-library","php","php-interface","smart-contracts","web3","web3-php","web3php"],"latest_commit_sha":null,"homepage":"http://ethereum-php.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitaldonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"digitaldonkey","patreon":"digitaldonkey","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2017-02-23T22:28:30.000Z","updated_at":"2025-04-03T15:53:33.000Z","dependencies_parsed_at":"2024-12-28T02:00:34.787Z","dependency_job_id":"6cc0d77d-42e9-40e1-8425-94f6474ece7e","html_url":"https://github.com/digitaldonkey/ethereum-php","commit_stats":{"total_commits":188,"total_committers":10,"mean_commits":18.8,"dds":"0.29255319148936165","last_synced_commit":"64eca01863e26b160e396277259a4df343301189"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaldonkey%2Fethereum-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaldonkey%2Fethereum-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaldonkey%2Fethereum-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaldonkey%2Fethereum-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitaldonkey","download_url":"https://codeload.github.com/digitaldonkey/ethereum-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254119471,"owners_count":22017951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","ethereum-client","ethereum-php","ethereum-php-library","php","php-interface","smart-contracts","web3","web3-php","web3php"],"created_at":"2024-08-03T22:01:10.569Z","updated_at":"2025-05-14T10:06:19.266Z","avatar_url":"https://github.com/digitaldonkey.png","language":"PHP","funding_links":["https://github.com/sponsors/digitaldonkey","https://patreon.com/digitaldonkey"],"categories":["Roadmap","Dapps development"],"sub_categories":["APIs / subproviders"],"readme":"# Ethereum-PHP\n\nis a typed PHP-7.1+ interface to [Ethereum JSON-RPC API](https://github.com/ethereum/wiki/wiki/JSON-RPC).\n\nCheck out the latest [API documentation](http://ethereum-php.org/dev/).\n\n### Add library in a [composer.json](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup) file\n\n```yaml\n{\n  \"minimum-stability\":\"dev\",\n  \"autoload\": {\n    \"psr-4\": {\n      \"Ethereum\\\\\": \"src/\"\n    }\n  },\n  \"repositories\": [\n    {\n      \"type\": \"git\",\n      \"url\": \"https://github.com/digitaldonkey/ethereum-php.git\"\n    }\n  ],\n  \"require\": {\n    \"digitaldonkey/ethereum-php\": \"dev-master\"\n  }\n}\n```\n\n### Usage\n\n\n```sh\ncomposer require digitaldonkey/ethereum-php\n```\n\nThis is the important part of [composer.json](https://github.com/digitaldonkey/ethereum/blob/8.x-1.x/composer.json) in [Drupal Ethereum Module](https://drupal.org/project/ethereum).\n\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\nuse Ethereum\\Ethereum;\n\ntry {\n\t// Connect to Ganache\n    $eth = new Ethereum('http://127.0.0.1:7545');\n    // Should return Int 63\n    echo $eth-\u003eeth_protocolVersion()-\u003eval();\n}\ncatch (\\Exception $exception) {\n    die (\"Unable to connect.\");\n}\n\n```\n\n**Calling Contracts**\n\nYou can call (unpayed) functions in smart contracts easily. \n\n The json file \"$fileName\" used is what you get when you compile a contract with [Truffle](truffleframework.com). \n\n```php\n$ContractMeta = json_decode(file_get_contents($fileName));\n$contract = new SmartContract(\n  $ContractMeta-\u003eabi,\n  $ContractMeta-\u003enetworks-\u003e{NETWORK_ID}-\u003eaddress,\n  new Ethereum(SERVER_URL)\n);\n$someBytes = new EthBytes('34537ce3a455db6b')\n$x = $contract-\u003emyContractMethod();\necho $x-\u003eval()\n```\n\nYou can also run tests at smart contracts, check out EthTestClient.\n\n### Event listening and handling\n\nYou can use Ethereum-PHP to watch changed on your smart contracts or index a Blockchain block by block. gs\n\nSee [UsingFilters](https://github.com/digitaldonkey/ethereum-php/blob/master/UsingFilters.md) and [ethereum-php-eventlistener](https://github.com/digitaldonkey/ethereum-php-eventlistener).\n\n\n### Limitations\n\nCurrently not all datatypes are supported.\n\nThis library is read-only for now. This means you can retrieve information stored in Ethereum Blockchain.\n\nTo *write* to the blockchain you need a to sign transactions with a private key which is not supported yet.\n\n\n![architecture diagram](https://raw.githubusercontent.com/digitaldonkey/ethereum-php/dev/doxygen-assets/ArchitectureDiagrammCS6.png \"Drupal Ethereum architecture\")\n\n### Documentation\n\nThe API documentation is available at [ethereum-php.org](http://ethereum-php.org/).\n\nFor reference see the [Ethereum RPC documentation](https://github.com/ethereum/wiki/wiki/JSON-RPC) and for data encoding [RLP dcumentation](https://github.com/ethereum/wiki/wiki/RLP) in [Ethereum Wiki](https://github.com/ethereum/wiki).\n\nThere is also a more readable [Ethereum Frontier Guide](http://ethereum.gitbooks.io/frontier-guide/content/rpc.html) version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitaldonkey%2Fethereum-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitaldonkey%2Fethereum-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitaldonkey%2Fethereum-php/lists"}