{"id":19306937,"url":"https://github.com/danmacnaughtan/swift-jsonrpcclient","last_synced_at":"2025-02-24T02:41:58.848Z","repository":{"id":154227205,"uuid":"130352927","full_name":"danmacnaughtan/Swift-JSONRPCClient","owner":"danmacnaughtan","description":"A simple Swift JSONRPC client.","archived":false,"fork":false,"pushed_at":"2018-04-20T11:26:40.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T01:09:33.226Z","etag":null,"topics":["jsonrpc","swift","swift-jsonrpc-client"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danmacnaughtan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-04-20T11:25:54.000Z","updated_at":"2018-11-23T15:39:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"5dd0823f-1b89-41bf-9213-3829184657b4","html_url":"https://github.com/danmacnaughtan/Swift-JSONRPCClient","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnaughtan%2FSwift-JSONRPCClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnaughtan%2FSwift-JSONRPCClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnaughtan%2FSwift-JSONRPCClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmacnaughtan%2FSwift-JSONRPCClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danmacnaughtan","download_url":"https://codeload.github.com/danmacnaughtan/Swift-JSONRPCClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240408990,"owners_count":19796788,"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":["jsonrpc","swift","swift-jsonrpc-client"],"created_at":"2024-11-10T00:08:59.050Z","updated_at":"2025-02-24T02:41:58.814Z","avatar_url":"https://github.com/danmacnaughtan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift JSONRPC Client\n\nA simple Swift JSONRPC client. \n\n## Requirements\n\n* [SwiftyJSON 3.1.4](https://github.com/SwiftyJSON/SwiftyJSON)\n\n## Usage\n\nThe example usage is using [SwiftHTTP\n3.0.0](https://github.com/daltoniam/SwiftHTTP).\n\n```Swift\n// create an instance of the client\nlet client = JSONRPCClient()\n\n// add a call (or calls) to some RPC method\nclient.query(id: 0, method: \"some-method\", params: [\"some\", \"params\"])\n\n// encode the parameters\nguard let params = client.encode() else {\n    fatalError(\"No RPC method queried in client.\")\n}\n\n// using SwiftHTTP+PostAny\nHTTP.postAny(\"https://mydomain/api/rpc\", params: params) { response in\n\n    if response.statusCode == 200 {\n        \n        // create a SwiftyJSON object to be decoded\n        let json = JSON(data: response.data)\n\n        // decode the JSONRPC message(s)\n        let results = client.decode(json) { exception: JSONRPCException in\n            // handle the RPC error\n        }\n\n        // do something with the results\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmacnaughtan%2Fswift-jsonrpcclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanmacnaughtan%2Fswift-jsonrpcclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmacnaughtan%2Fswift-jsonrpcclient/lists"}