All Projects → EOSEssentials → Eos Java Rpc Wrapper

EOSEssentials / Eos Java Rpc Wrapper

Licence: mit

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Eos Java Rpc Wrapper

Eos Contract
Tutorial on writing smart contracts on EOS EOS智能合约教程,从零开始学习EOS智能合约, DApp安全漏洞(security)及攻击实践(EOS Contract)(Powered by Itleaks)
Stars: ✭ 163 (+0.62%)
Mutual labels:  smart-contracts, eos
eosgo-client
A simple Go wrapper of EOS (eosio) RPC API, and more!
Stars: ✭ 29 (-82.1%)
Mutual labels:  smart-contracts, eos
Eosfactory
Python-based EOS smart-contract development & testing framework
Stars: ✭ 247 (+52.47%)
Mutual labels:  smart-contracts, eos
Smart-Contract-Security-Audits
Certified Smart Contract Audits (Ethereum, Hyperledger, xDAI, Huobi ECO Chain, Binance Smart Chain, Fantom, EOS, Tezos) by Chainsulting
Stars: ✭ 325 (+100.62%)
Mutual labels:  smart-contracts, eos
luckydog
luckydog(锦鲤) 一个幸运小游戏
Stars: ✭ 14 (-91.36%)
Mutual labels:  smart-contracts, eos
Octopus
Security Analysis tool for WebAssembly module (wasm) and Blockchain Smart Contracts (BTC/ETH/NEO/EOS)
Stars: ✭ 261 (+61.11%)
Mutual labels:  smart-contracts, eos
Peatiocryptoexchange
An open-source Crypto-Currency exchange. Peatio v3.0 Coming Soon !
Stars: ✭ 141 (-12.96%)
Mutual labels:  smart-contracts
Census Data Downloader
Download U.S. census data and reformat it for humans
Stars: ✭ 149 (-8.02%)
Mutual labels:  api-wrapper
Blockchainbooks.github.io
Blockchain Books
Stars: ✭ 139 (-14.2%)
Mutual labels:  smart-contracts
Twitch Python
Object-oriented Twitch API for Python developers
Stars: ✭ 138 (-14.81%)
Mutual labels:  api-wrapper
Ico Contracts
Ethereum smart contracts that have been used during successful ICOs
Stars: ✭ 160 (-1.23%)
Mutual labels:  smart-contracts
Signupeoseos
DApp for creating your own EOS account easily
Stars: ✭ 156 (-3.7%)
Mutual labels:  eos
Convector
Smart Contract Systems the easy way. Open source development framework.
Stars: ✭ 147 (-9.26%)
Mutual labels:  smart-contracts
Liquidity
A high-level language for Dune Network (and Tezos) with OCaml and ReasonML syntaxes, with a decompiler from Michelson
Stars: ✭ 144 (-11.11%)
Mutual labels:  smart-contracts
Ebtc
eBitcoin (eBTC) is an ERC20 token. Its primary utility is to provide an easy & fast payment solution. Its edge over other tokens is that it is capable of sending up to 255 payments in a single transaction.
Stars: ✭ 149 (-8.02%)
Mutual labels:  smart-contracts
Flow Nft
The Non-Fungible Token standard on the Flow Blockchain
Stars: ✭ 138 (-14.81%)
Mutual labels:  smart-contracts
Simpleos
EOSIO Blockchain Interface & Wallet
Stars: ✭ 157 (-3.09%)
Mutual labels:  eos
Cryptokylin Testnet
EOS.io Kylin Testnet by cryptokylin.io
Stars: ✭ 140 (-13.58%)
Mutual labels:  eos
Sablier
The protocol for real-time finance on the Ethereum blockchain
Stars: ✭ 147 (-9.26%)
Mutual labels:  smart-contracts
Pinterest Api Php
A PHP wrapper for the official Pinterest API. 📌
Stars: ✭ 151 (-6.79%)
Mutual labels:  api-wrapper

EOS Java API Wrapper

Note: This library is not actively updated. Some adjustments may be required to work with the latest version of EOSIO.

A Java implementation of the EOS RPC Calls. Under the MIT Licence.

Created by eos42.

The api documentation can be found in the official eos developers portal: https://developers.eos.io/eosio-nodeos/reference

All but the following queries are supported:

  1. CHAIN
  • get_header_block_state
  • get_producers
  • push_block
  1. WALLET
  • set_dir
  • set_eosio_key
  1. NET
  • connect
  • disconnect
  • connections
  • status
  1. PRODUCER
  • pause
  • resume
  • paused

Requirements

  • Java 8
  • Maven

Installation

Install using maven build tool. The artifact will need to be published locally.

Currently the artifiac is not in the official maven repositories. If you want to use it in a maven build, you can add the following repository

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

and dependency

<dependency>
    <groupId>com.github.EOSEssentials</groupId>
    <artifactId>eos-java-rpc-wrapper</artifactId>
    <version>master</version>
</dependency>

Configuration

Create a new instance of EosApiClient using the EosApiClientFactory, this will require a baseurl to be passed in.

This will use the same base url for all three api endpoints (history/chain/wallet).

EosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance("http://127.0.0.1:8888").newRestClient();

If you want to use separate urls for those endpoints (e.g. you have a local wallet):

EosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance(
    walletBaseUrl, chainBaseUrl, historyBaseUrl).newRestClient();

Example Usage

Creating a wallet
eosApiRestClient.createWallet("walletName");

Getting a block

eosApiRestClient.getBlock("blockNumberOrId")

Signing and pushing a transaction

/* Create the rest client */
EosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance("http://127.0.0.1:8888").newRestClient();

/* Create the json array of arguments */
Map<String, String> args = new HashMap<>(4);
args.put("from", "currency");
args.put("to", "eosio");
args.put("quantity", "44.0000 CUR");
args.put("memo", "My First Transaction");
AbiJsonToBin data = eosApiRestClient.abiJsonToBin("currency", "transfer", args);```

/* Get the head block */
Block block = eosApiRestClient.getBlock(eosApiRestClient.getChainInfo().getHeadBlockId());

/* Create Transaction Action Authorization */
TransactionAuthorization transactionAuthorization = new TransactionAuthorization();
transactionAuthorization.setActor("currency");
transactionAuthorization.setPermission("active");

/* Create Transaction Action */
TransactionAction transactionAction = new TransactionAction();
transactionAction.setAccount("currency");
transactionAction.setName("transfer");
transactionAction.setData(data.getBinargs());
transactionAction.setAuthorization(Collections.singletonList(transactionAuthorization));

/* Create a transaction */
PackedTransaction packedTransaction = new PackedTransaction();
packedTransaction.setRefBlockPrefix(block.getRefBlockPrefix().toString());
packedTransaction.setRefBlockNum(block.getBlockNum().toString());
packedTransaction.setExpiration("2018-05-10T18:38:19");
packedTransaction.setRegion("0");
packedTransaction.setMax_net_usage_words("0");
packedTransaction.setActions(Collections.singletonList(transactionAction));

/* Sign the Transaction */
SignedPackedTransaction signedPackedTransaction = eosApiRestClient.signTransaction(packedTransaction, Collections.singletonList("EOS7LPJ7YnwYiEHbBLz96fNkt3kf6CDDdesV5EsWoc3u3DJy31V2y"), "chainId");

/* Push the transaction */
PushedTransaction = eosApiRestClient.pushTransaction("none", signedPackedTransaction);

Notes

  • All methods are synchronous and blocking.
  • All methods will throw a catchable EOSApiException.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].