{"id":37004221,"url":"https://github.com/pete001/php-eos-rpc-sdk","last_synced_at":"2026-01-14T00:37:10.905Z","repository":{"id":62495195,"uuid":"137772733","full_name":"pete001/php-eos-rpc-sdk","owner":"pete001","description":"A PHP SDK for the EOS RPC API","archived":false,"fork":false,"pushed_at":"2020-07-20T20:39:29.000Z","size":95,"stargazers_count":56,"open_issues_count":6,"forks_count":35,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-19T09:49:31.488Z","etag":null,"topics":["api","eos","php","sdk","sdk-php"],"latest_commit_sha":null,"homepage":"https://blockmatrix.network","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/pete001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-18T15:47:24.000Z","updated_at":"2025-04-25T15:53:56.000Z","dependencies_parsed_at":"2022-11-02T09:32:09.768Z","dependency_job_id":null,"html_url":"https://github.com/pete001/php-eos-rpc-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pete001/php-eos-rpc-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pete001%2Fphp-eos-rpc-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pete001%2Fphp-eos-rpc-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pete001%2Fphp-eos-rpc-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pete001%2Fphp-eos-rpc-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pete001","download_url":"https://codeload.github.com/pete001/php-eos-rpc-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pete001%2Fphp-eos-rpc-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","eos","php","sdk","sdk-php"],"created_at":"2026-01-14T00:37:10.133Z","updated_at":"2026-01-14T00:37:10.854Z","avatar_url":"https://github.com/pete001.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The PHP SDK for the EOS RPC API\n\nA PHP wrapper for the EOS Chain/Wallet RPC API.\n\n## Background\n\nYou can check out the [RPC API reference](https://developers.eos.io/eosio-nodeos/reference) but \nbeware that some of the newer methods are missing.\nWallet RPC APIs are implemented as [v1.1.0 of RPC API reference](https://developers.eos.io/eosio-nodeos/v1.1.0/reference).\nAlso, some of the examples in those docs use outdated syntax.\n\n## Installing\n\n```php\ncomposer require manamine/php-eos-rpc-sdk\n```\n\n## Configuration\n\nCreate a dotenv `.env` file in the project root, with your favorite RPC API host and KEOSD. You can use\n`.env.example` as a template:\n\n```\ncp .env.example .env\n```\n\n## Usage\n\nThere is a shiny factory method to auto instantiate all dependencies: \n\n```php\n$api = (new ChainFactory)-\u003eapi();\n$walapi = (new WalletFactory)-\u003eapi();\n$eos = (new EosRpc($api, $walapi));\n```\n\n## Examples\n\nTo get you started, there is a simple example runner which covers all API commands.\n\nJust run this via cli to see example output for all commands:\n\n```\ncd examples\nphp chain.php\nphp wallet.php\nphp eosrpc.php\n```\n\n## API Methods\n\nAlmost Chain/Wallet API methods are covered.\n\n## Chain APIs\n\n### Get Info\n\nGet latest information related to a node\n\n```php\necho $api-\u003egetInfo();\n```\n\n### Get Block\n\nGet information related to a block\n\n```php\necho $api-\u003egetBlock(\"1337\");\n```\n\n### Get Block Header State\n\nGet information related to a block header state\n\n```php\necho $api-\u003egetBlockHeaderState(\"0016e48707b181d93117b07451d9837526eba34a9a37125689fb5a73a5d28a38\");\n```\n\n### Get Account\n\nGet information related to an account\n\n```php\n$api-\u003egetAccount(\"blockmatrix1\");\n```\n\n### Get Code\n\nFetch smart contract code\n\n```php\necho $api-\u003egetCode(\"eosio.token\");\n```\n\n### Get Table Rows\n\nFetch smart contract data from an account\n\n```php\necho $api-\u003egetTableRows(\"eosio\", \"eosio\", \"producers\", [\"limit\" =\u003e 10]);\n```\n\n### Get Currency Balance\n\nFetch currency balance(s) for an account\n\n```php\necho $api-\u003egetCurrencyBalance(\"eosio.token\", \"eosdacserver\");\n```\n\n### Get Currency Stats\n\nFetch stats for a currency\n\n```php\necho $api-\u003egetCurrencyStats(\"eosio.token\", \"EOS\");\n```\n\n### Get ABI\n\nGet an account ABI\n\n```php\necho $api-\u003egetAbi(\"eosio.token\");\n```\n\n### Get Raw Code and ABI\n\nGet raw code and ABI\n\n```php\necho $api-\u003egetRawCodeAndAbi(\"eosio.token\");\n```\n\n### Get Producers\n\nList the producers\n\n```php\necho $api-\u003egetProducers(10);\n```\n\n### ABI JSON To Bin\n\nSerialize json to binary hex\n\n```php\necho $api-\u003eabiJsonToBin(\"eosio.token\", \"transfer\", [\"blockmatrix1\", \"blockmatrix1\", \"7.0000 EOS\", \"Testy McTest\"]);\n```\n\n### ABI Bin To JSON\n\nSerialize back binary hex to json\n\n```php\necho $api-\u003eabiBinToJson(\"eosio.token\", \"transfer\", \"10babbd94888683c10babbd94888683c701101000000000004454f53000000000c5465737479204d6354657374\");\n```\n\n### Get Required Keys\n\nGet the required keys needed to sign a transaction\n\n```php\necho $api-\u003egetRequiredKeys(\n     [\n         \"expiration\" =\u003e \"2018-08-23T05.00.00\",\n         \"ref_block_num\" =\u003e 15078,\n         \"ref_block_prefix\" =\u003e 1071971392,\n         \"max_net_usage_words\" =\u003e 0,\n         \"delay_sec\" =\u003e 0,\n         \"context_free_actions\" =\u003e [],\n         \"actions\" =\u003e [\n             [\n                 \"account\" =\u003e \"eosio.token\",\n                 \"name\" =\u003e \"transfer\",\n                 \"authorization\" =\u003e [\n                     [\n                         \"actor\" =\u003e \"user\",\n                         \"permission\" =\u003e \"active\"\n                     ]\n                 ],\n                 \"data\" =\u003e \"00000000007015d6000000005c95b1ca102700000000000004454f53000000000c757365722d3e746573746572\"\n             ]\n         ],\n         \"transaction_extensions\" =\u003e []\n     ],\n     [\n         \"EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4\"\n     ]\n );\n```\n\n### Push Transaction\n\nPush a transaction\n\n```php\necho $api-\u003epushTransaction(\"2018-08-23T05:29:39\", \"15780\", \"90170226\",\n    [\n        \"actions\" =\u003e [\n            [\n                \"account\" =\u003e \"eosio.token\",\n                \"name\" =\u003e \"transfer\",\n                \"authorization\" =\u003e [\n                    [\n                        \"actor\" =\u003e \"user\",\n                        \"permission\" =\u003e \"active\"\n                    ]\n                ],\n                \"data\" =\u003e \"00000000007015d6000000005c95b1ca102700000000000004454f53000000000c757365722d3e746573746572\"\n            ]\n        ],\n        \"signatures\" =\u003e [\n            \"SIG_K1_KaGHyi59BRqfaDUK6424TYEWcUhWxAG7BLCgYC8vwYNgaHgGLpduTUbNQEsfL8xLzboK8W9T2X69bNpqozTQVCbRSNJWFd\"\n        ]\n    ]\n);\n```\n\n### Push Transactions\n\nPush transactions\n\n```php\necho $api-\u003epushTransactions(\n    [\n        [\n            \"compression\" =\u003e \"none\",\n            \"transaction\" =\u003e [\n                \"expiration\" =\u003e \"2018-08-23T06:27:26\",\n                \"ref_block_num\" =\u003e 22017,\n                \"ref_block_prefix\" =\u003e 3920123292,\n                \"context_free_actions\" =\u003e [],\n                \"actions\" =\u003e [\n                    [\n                        \"account\" =\u003e \"eosio.token\",\n                        \"name\" =\u003e \"transfer\",\n                        \"authorization\" =\u003e [\n                            [\n                                \"actor\" =\u003e \"user\",\n                                \"permission\" =\u003e \"active\"\n                            ]\n                        ],\n                        \"data\" =\u003e \"00000000007015d6000000005c95b1ca102700000000000004454f53000000000c757365722d3e746573746572\"\n                    ]\n                ],\n                \"transaction_extensions\" =\u003e []\n            ],\n            \"signatures\" =\u003e [\n                \"SIG_K1_JzN9DnpyhKfjoef3C2TZBTPA5b6ftwuEBnBpvzkueVXThJ34PFFpUFgqyayfXjeLRc15JmZmDiMYAFX99hUgX8vkGAYcnx\"\n            ]\n        ],\n        [\n            \"compression\" =\u003e \"none\",\n            \"transaction\" =\u003e [\n                \"expiration\" =\u003e \"2018-08-23T06:27:26\",\n                \"ref_block_num\" =\u003e 22017,\n                \"ref_block_prefix\" =\u003e 3920123292,\n                \"context_free_actions\" =\u003e [],\n                \"actions\" =\u003e [\n                    [\n                        \"account\" =\u003e \"eosio.token\",\n                        \"name\" =\u003e \"transfer\",\n                        \"authorization\" =\u003e [\n                            [\n                                \"actor\" =\u003e \"tester\",\n                                \"permission\" =\u003e \"active\"\n                            ]\n                        ],\n                        \"data\" =\u003e \"000000005c95b1ca00000000007015d6881300000000000004454f53000000000c7465737465722d3e75736572\"\n                    ]\n                ],\n                \"transaction_extensions\" =\u003e []\n            ],\n            \"signatures\" =\u003e [\n                \"SIG_K1_KZ2M4AG59tptdRCpqbwzMQvBv1dce5btJCJiCVVy96fTGepApGXqJAwsi17g8AQdJjUQB4R62PprfdUdRYHGdBqK1z9Sx9\"\n            ]\n        ]\n    ]\n);\n```\n\n## Wallet APIs\n\n### Create\n\nCreates a new wallet with the given name\n\n```php\necho $walapi-\u003ecreate(\"testwallet\");\n```\n\n### Open\n\nOpens an existing wallet of the given name\n\n```php\necho $walapi-\u003eopen(\"testwallet\");\n```\n\n### Lock\n\nLocks an existing wallet of the given name\n\n```php\necho $walapi-\u003elock(\"testwallet\");\n```\n\n### Lock All\n\nLocks all existing wallets\n\n```php\necho $walapi-\u003elockAll();\n```\n\n### Unlock\n\nUnlocks a wallet with the given name and password\n\n```php\necho $walapi-\u003eunlock([\"testwallet\", \"PW5Jb8RAZP6CBjjMLPser3T8i8k9hZXZkMBJ8kb1p6f6hAg2n68jY\"]);\n```\n\n### Import Key\n\nImports a private key to the wallet of the given name\n\n```php\necho $walapi-\u003eimportKey([\"testwallet\", \"5Jmsawgsp1tQ3GD6JyGCwy1dcvqKZgX6ugMVMdjirx85iv5VyPR\"]);\n```\n\n### Remove Key\n\nRemoves a key pair from the wallet of the given name\n\n```php\necho $walapi-\u003eremoveKey([\"testwallet\", \"PW5Jb8RAZP6CBjjMLPser3T8i8k9hZXZkMBJ8kb1p6f6hAg2n68jY\", \"EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4\"]);\n```\n\n### Create Key\n\nCreates a key pair and import\n\n```php\necho $walapi-\u003ecreateKey([\"testwallet\", \"K1\"]);\n```\n\n### List Wallets\n\nLists all wallets\n\n```php\necho $walapi-\u003elistWallets();\n```\n\n### List Keys\n\nLists all key pairs from the wallet of the given name and password\n\n```php\necho $walapi-\u003elistKeys([\"testwallet\", \"PW5Jb8RAZP6CBjjMLPser3T8i8k9hZXZkMBJ8kb1p6f6hAg2n68jY\"]);\n```\n\n### Get Public Keys\n\nLists all public keys across all wallets\n\n```php\necho $walapi-\u003egetPublicKeys();\n```\n\n### Set Timeout\n\nSets wallet auto lock timeout (in seconds)\n\n```php\necho $walapi-\u003esetTimeout(60);\n```\n\n### Sign Transaction\n\nSigns a transaction\n\n```php\necho $walapi-\u003esignTransaction(\n    [\n        \"expiration\" =\u003e \"2018-08-23T06:35:30\",\n        \"ref_block_num\" =\u003e 22985,\n        \"ref_block_prefix\" =\u003e 3016594541,\n        \"max_net_usage_workds\" =\u003e 0,\n        \"delay_sec\" =\u003e 0,\n        \"context_free_actions\" =\u003e [],\n        \"actions\" =\u003e [\n            [\n                \"account\" =\u003e \"eosio.token\",\n                \"name\" =\u003e \"transfer\",\n                \"authorization\" =\u003e [\n                    [\n                        \"actor\" =\u003e \"user\",\n                        \"permission\" =\u003e \"active\"\n                    ]\n                ],\n                \"data\" =\u003e \"00000000007015d6000000005c95b1ca102700000000000004454f53000000000c757365722d3e746573746572\"\n            ]\n        ],\n        \"transaction_extensions\" =\u003e []\n    ],\n    [\n        \"EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4\"\n    ],\n    \"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f\"\n);\n```\n\n## EOS Wrapper APIs\n\n### Prerequisites\n\nNeed to set wallet name and password\n\n```php\n$eos-\u003esetWalletInfo(\"testwallet\", \"PW5Jb8RAZP6CBjjMLPser3T8i8k9hZXZkMBJ8kb1p6f6hAg2n68jY\");\n```\n\n### Push Transaction\n\nPush a transaction\n\n```php\necho $eos-\u003epushTransaction(\n    [\n        [\n            \"account\" =\u003e \"eosio.token\",\n            \"name\" =\u003e \"transfer\",\n            \"authorization\" =\u003e [\n                [\n                    \"actor\" =\u003e \"user\",\n                    \"permission\" =\u003e \"active\"\n                ]\n            ],\n            \"data\" =\u003e [\n                \"from\" =\u003e \"user\",\n                \"to\" =\u003e \"tester\",\n                \"quantity\" =\u003e \"1.0000 EOS\",\n                \"memo\" =\u003e \"memo\"\n            ]\n        ]\n    ]\n);\n```\n\n### Make Transaction\n\nMake a transaction (useful for pushTransactions)\n\n```php\n$trx = $eos-\u003emakeTransaction(\n    [\n        [\n            \"account\" =\u003e \"eosio.token\",\n            \"name\" =\u003e \"transfer\",\n            \"authorization\" =\u003e [\n                [\n                    \"actor\" =\u003e \"user\",\n                    \"permission\" =\u003e \"active\"\n                ]\n            ],\n            \"data\" =\u003e [\n                \"from\" =\u003e \"user\",\n                \"to\" =\u003e \"tester\",\n                \"quantity\" =\u003e \"1.0000 EOS\",\n                \"memo\" =\u003e \"memo\"\n            ]\n        ]\n    ]\n);\n```\n\n### Push Transactions\n\nPush transactions\n\n```php\n$trx_ids = $eos-\u003epushTransactions(\n    [\n        $eos-\u003emakeTransaction(\n            [\n                [\n                    \"account\" =\u003e \"eosio.token\",\n                    \"name\" =\u003e \"transfer\",\n                    \"authorization\" =\u003e [\n                        [\n                            \"actor\" =\u003e \"user\",\n                            \"permission\" =\u003e \"active\"\n                        ]\n                    ],\n                    \"data\" =\u003e [\n                        \"from\" =\u003e \"user\",\n                        \"to\" =\u003e \"tester\",\n                        \"quantity\" =\u003e \"1.0000 EOS\",\n                        \"memo\" =\u003e \"memo\"\n                    ]\n                ]\n            ]\n        ),\n        $eos-\u003emakeTransaction(\n            [\n                [\n                    \"account\" =\u003e \"eosio.token\",\n                    \"name\" =\u003e \"transfer\",\n                    \"authorization\" =\u003e [\n                        [\n                            \"actor\" =\u003e \"tester\",\n                            \"permission\" =\u003e \"active\"\n                        ]\n                    ],\n                    \"data\" =\u003e [\n                        \"from\" =\u003e \"tester\",\n                        \"to\" =\u003e \"user\",\n                        \"quantity\" =\u003e \"0.5000 EOS\",\n                        \"memo\" =\u003e \"memo\"\n                    ]\n                ]\n            ]\n        )\n    ]\n);\nforeach ($trx_ids as $key =\u003e $value) {\n    echo $trx_ids[$key]['transaction_id'] . PHP_EOL;\n}\n```\n\n### Push Action\n\nPush an action\n\n```php\necho $eos-\u003epushAction(\"eosio\", \"buyram\", [\"payer\"=\u003e\"tester\",\"receiver\"=\u003e\"tester\",\"quant\"=\u003e\"1.0000 EOS\"], [\"actor\"=\u003e\"tester\",\"permission\"=\u003e\"active\"]);\n```\n\n### Transfer\n\nTransfers token\n\n```php\necho $eos-\u003etransfer(\"user\", \"tester\", \"1.0000 EOS\", \"memo\");\n```\n\n### Create Key Pair\n\nCreates a key pair and returns\n\n```php\n$keyPair = $eos-\u003ecreateKeyPair(\"K1\");\necho \"$keyPair[0], $keyPair[1]\";\n```\n\n## Tests\n\nTo run the test suites, simply execute:\n\n```php\nvendor/bin/phpunit\n```\n\nIf you wanna get fancy and check code coverage:\n\n```php\nvendor/bin/phpunit --coverage-html tests/coverage\n```\n\nIf you're really bored, you might wanna run some static analysis:\n\n```php\nvendor/bin/phpmetrics --report-html=\"tests/static\" .\n```\n\n## Contributing\n\nAll contributions are welcome! Just fire up a PR, make sure your code style is PSR-2 compliant: \n\n```php\nvendor/bin/php-cs-fixer fix --verbose\n```\n\n## License\n\nFree for everyone!\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpete001%2Fphp-eos-rpc-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpete001%2Fphp-eos-rpc-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpete001%2Fphp-eos-rpc-sdk/lists"}