{"id":13453540,"url":"https://github.com/EOSEssentials/eos-java-rpc-wrapper","last_synced_at":"2025-03-24T01:31:36.871Z","repository":{"id":91565582,"uuid":"130099638","full_name":"EOSEssentials/eos-java-rpc-wrapper","owner":"EOSEssentials","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-13T11:26:48.000Z","size":143,"stargazers_count":161,"open_issues_count":10,"forks_count":75,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-17T18:56:46.910Z","etag":null,"topics":["api-wrapper","eos","java","smart-contracts"],"latest_commit_sha":null,"homepage":"http://www.eos42.io","language":"Java","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/EOSEssentials.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-18T17:38:26.000Z","updated_at":"2025-03-11T06:54:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ef90fac-cb6b-4338-9831-c41af80919c3","html_url":"https://github.com/EOSEssentials/eos-java-rpc-wrapper","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/EOSEssentials%2Feos-java-rpc-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EOSEssentials%2Feos-java-rpc-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EOSEssentials%2Feos-java-rpc-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EOSEssentials%2Feos-java-rpc-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EOSEssentials","download_url":"https://codeload.github.com/EOSEssentials/eos-java-rpc-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245194249,"owners_count":20575729,"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":["api-wrapper","eos","java","smart-contracts"],"created_at":"2024-07-31T08:00:42.597Z","updated_at":"2025-03-24T01:31:35.645Z","avatar_url":"https://github.com/EOSEssentials.png","language":"Java","readme":"# EOS Java API Wrapper\nNote: This library is not actively updated. Some adjustments may be required to work with the latest version of EOSIO.\n\n*A Java implementation of the EOS RPC Calls. Under the [MIT Licence](https://raw.githubusercontent.com/Fletch153/eos-java-rpc-wrapper/master/LICENSE)*.\n\nCreated by [eos42](http://www.eos42.io).\n\nThe api documentation can be found in the official eos developers portal:\nhttps://developers.eos.io/eosio-nodeos/reference\n\nAll but the following queries are supported:\n1. CHAIN\n- get_header_block_state\n- get_producers\n- push_block\n2. WALLET\n- set_dir\n- set_eosio_key\n3. NET\n- connect\n- disconnect\n- connections\n- status\n4. PRODUCER\n- pause\n- resume\n- paused\n\n#### Requirements\n* Java 8\n* Maven\n\n#### Installation\nInstall using maven build tool. The artifact will need to be published locally.\n\nCurrently the artifiac is not in the official maven repositories.\nIf you want to use it in a maven build, you can add the following repository\n\n``` xml\n\u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\u003c/repository\u003e\n```\n\nand dependency\n\n``` xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.EOSEssentials\u003c/groupId\u003e\n    \u003cartifactId\u003eeos-java-rpc-wrapper\u003c/artifactId\u003e\n    \u003cversion\u003emaster\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Configuration\nCreate a new instance of EosApiClient using the EosApiClientFactory, this will require\na baseurl to be passed in.\n\nThis will use the same base url for all three api endpoints (history/chain/wallet).\n```java\nEosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance(\"http://127.0.0.1:8888\").newRestClient();\n```\n\nIf you want to use separate urls for those endpoints (e.g. you have a local wallet):\n```java\nEosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance(\n    walletBaseUrl, chainBaseUrl, historyBaseUrl).newRestClient();\n```\n\n#### Example Usage\n##### Creating a wallet\n```java\neosApiRestClient.createWallet(\"walletName\");\n```\n\n#### Getting a block\n```java\neosApiRestClient.getBlock(\"blockNumberOrId\")\n```\n\n#### Signing and pushing a transaction\n\n```java\n/* Create the rest client */\nEosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance(\"http://127.0.0.1:8888\").newRestClient();\n\n/* Create the json array of arguments */\nMap\u003cString, String\u003e args = new HashMap\u003c\u003e(4);\nargs.put(\"from\", \"currency\");\nargs.put(\"to\", \"eosio\");\nargs.put(\"quantity\", \"44.0000 CUR\");\nargs.put(\"memo\", \"My First Transaction\");\nAbiJsonToBin data = eosApiRestClient.abiJsonToBin(\"currency\", \"transfer\", args);```\n\n/* Get the head block */\nBlock block = eosApiRestClient.getBlock(eosApiRestClient.getChainInfo().getHeadBlockId());\n\n/* Create Transaction Action Authorization */\nTransactionAuthorization transactionAuthorization = new TransactionAuthorization();\ntransactionAuthorization.setActor(\"currency\");\ntransactionAuthorization.setPermission(\"active\");\n\n/* Create Transaction Action */\nTransactionAction transactionAction = new TransactionAction();\ntransactionAction.setAccount(\"currency\");\ntransactionAction.setName(\"transfer\");\ntransactionAction.setData(data.getBinargs());\ntransactionAction.setAuthorization(Collections.singletonList(transactionAuthorization));\n\n/* Create a transaction */\nPackedTransaction packedTransaction = new PackedTransaction();\npackedTransaction.setRefBlockPrefix(block.getRefBlockPrefix().toString());\npackedTransaction.setRefBlockNum(block.getBlockNum().toString());\npackedTransaction.setExpiration(\"2018-05-10T18:38:19\");\npackedTransaction.setRegion(\"0\");\npackedTransaction.setMax_net_usage_words(\"0\");\npackedTransaction.setActions(Collections.singletonList(transactionAction));\n\n/* Sign the Transaction */\nSignedPackedTransaction signedPackedTransaction = eosApiRestClient.signTransaction(packedTransaction, Collections.singletonList(\"EOS7LPJ7YnwYiEHbBLz96fNkt3kf6CDDdesV5EsWoc3u3DJy31V2y\"), \"chainId\");\n\n/* Push the transaction */\nPushedTransaction = eosApiRestClient.pushTransaction(\"none\", signedPackedTransaction);\n```\n\n#### Notes\n* All methods are synchronous and blocking.\n* All methods will throw a catchable EOSApiException.\n","funding_links":[],"categories":["Language Support","Developers"],"sub_categories":["Java","Libraries and Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEOSEssentials%2Feos-java-rpc-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEOSEssentials%2Feos-java-rpc-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEOSEssentials%2Feos-java-rpc-wrapper/lists"}