{"id":16296702,"url":"https://github.com/hernandev/light-rpc","last_synced_at":"2025-03-20T04:31:31.662Z","repository":{"id":62515982,"uuid":"125172903","full_name":"hernandev/light-rpc","owner":"hernandev","description":"LightRPC is a Light, Easy and Simple JSON-RPC 2.0 client for PHP","archived":false,"fork":false,"pushed_at":"2020-06-24T13:53:17.000Z","size":25,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:11:54.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/hernandev.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-03-14T07:30:19.000Z","updated_at":"2020-04-27T00:09:52.000Z","dependencies_parsed_at":"2022-11-02T13:15:58.383Z","dependency_job_id":null,"html_url":"https://github.com/hernandev/light-rpc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flight-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flight-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flight-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flight-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hernandev","download_url":"https://codeload.github.com/hernandev/light-rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244052070,"owners_count":20390029,"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":[],"created_at":"2024-10-10T20:23:42.568Z","updated_at":"2025-03-20T04:31:31.365Z","avatar_url":"https://github.com/hernandev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LightRPC\n\n[![Build Status](https://travis-ci.org/hernandev/light-rpc.svg?branch=master)](https://travis-ci.org/hernandev/light-rpc)\n[![Codecov](https://codecov.io/gh/hernandev/light-rpc/branch/master/graph/badge.svg)](https://codecov.io/gh/hernandev/light-rpc)\n[![Latest Stable Version](https://poser.pugx.org/hernandev/light-rpc/v/stable)](https://packagist.org/packages/hernandev/light-rpc)\n[![License](https://poser.pugx.org/hernandev/light-rpc/license)](https://packagist.org/packages/hernandev/light-rpc)\n\n**LightRPC**: An easy, simple and effective `JSON-RPC` 2 client for PHP.\n\n#### This client was designed inspired by the Javascript project [LightRPC](https://github.com/busyorg/lightrpc).\n\n## 1. Background.\n\nThis project main objective is to communicate with [STEEM](https://steem.io) blockchain JSON-RPC servers. It was made simple \nenough to fit any `JSON-RPC` 2 service but default values are intended to make it easy on STEEM.\n\n## 2. Install:\n\nDead simple:\n\n```bash\ncomposer require hernandev/light-rpc\n```\n\n## 3. Usage:\n\nDead simple, chose one:\n\n### 3.1. Direct calls:\n\n```php\n\n// alias.\nuse LightRPC\\Client;\n\n// start a client instance.\n$client = new Client('https://api.steemit.com');\n\n// call it.\n$response = $client-\u003ecall('follow_api', 'get_follow_count', ['hernandev']);\n\n```\n\n### 3.2. Request instances.\n\n```php\n\n// alias.\nuse LightRPC\\Client;\nuse LightRPC\\Request;\n\n// start a client instance.\n$client = new Client('https://api.steemit.com');\n\n// create a request instance.\n$request = new Request('follow_api', 'get_follow_count', ['hernandev']);\n\n// send it.\n$response = $client-\u003esend($request);\n\n```\n\n### 3.3. Handling responses:\n\nDead simple, chose one:\n\n```php\n\n// wanna check for errors?\n$response-\u003eisError();\n\n\n// use the magic result getters.\n$response-\u003eaccount;           // 'hernandev'\n$response-\u003efollower_count;    // 123\n$response-\u003efollowing_count;   // 123\n\n// OR\n\n// use a get method:\n$response-\u003eget('account');           // 'hernandev'\n$response-\u003eget('follower_count');    // 123\n$response-\u003eget('following_count');   // 123\n\n// OR\n\n// get all result OR error data:\n$response-\u003edata();  // [ 'account' =\u003e 'hernandev', 'following_count' =\u003e 123, 'follower_count' =\u003e 123]\n$response-\u003eget();   // [ 'account' =\u003e 'hernandev', 'following_count' =\u003e 123, 'follower_count' =\u003e 123]\n\n// OR\n\n// If you are a boring person, just get the full response as array.\n$response-\u003etoArray(); // [ 'jsonrpc' =\u003e '2.0', 'id' =\u003e 0, 'result' =\u003e ['foo' =\u003e 'bar']]\n\n// You are really boring you know, wanna as JSON string?\n(string) $response; // '{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{...}}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhernandev%2Flight-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhernandev%2Flight-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhernandev%2Flight-rpc/lists"}