SteemJ V0.3.2 has been released – Use multiple Accounts - Update #14

in #steemdev7 years ago

Have you ever tried to perform a VoteOperation and a TransferOperation for different Accounts? SteemJ v0.3.2 can now handle this use case and other great improvements.


SteemJV2Logo


Previous 0.3.x releases: v0.3.1 v0.3.0

SteemJ v0.3.2 has been released

Hello Steemians!

I am proud to share a new SteemJ release with you. This release contains changes I’ve postponed for a while, because they required some bigger, internal adjustments. In the last two weeks I decided to finally work on those issues. Everything worked better than expected so that I can now announce that SteemJ is able to handle private keys of multiple accounts.

If you ask yourself why this is needed, here is a small example. Before SteemJ v0.3.2 it was not possible to perform a VoteOperation with the account fooa and a TransformOperation with the account foob in the same Transaction.


ChangesEverywhere
Source - medium.com

As I mentioned in the beginning there was a price to pay – The first thing is that I had to change nearly every class to handle the keys of different users correctly. This can cause some side effects and new bugs, while I still hope that the existing tests helped me to eliminate them all. The second change effects you, the user, because you now have to store your keys in another way.

Handle Private Keys Before SteemJ 0.3.2

myConfig.setPrivateKey(PrivateKeyType.POSTING, "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3");
        myConfig.setPrivateKey(PrivateKeyType.ACTIVE, "5KQasdf7ASD8weASdW37FSSsadfAImkwASd732QzDeyXtP79zk");

Handle Private Keys After SteemJ 0.3.2

List<ImmutablePair<PrivateKeyType, String>> privateKeys = new ArrayList<>();

privateKeys.add(new ImmutablePair<>(PrivateKeyType.POSTING, "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));
privateKeys.add(new ImmutablePair<>(PrivateKeyType.ACTIVE, "6KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));
privateKeys.add(new ImmutablePair<>(PrivateKeyType.OWNER, "7KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));

myConfig.getPrivateKeyStorage().addAccount(new AccountName("dez1337"), privateKeys);

privateKeys = new ArrayList<>();

privateKeys.add(new ImmutablePair<>(PrivateKeyType.POSTING, "5ABwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));
privateKeys.add(new ImmutablePair<>(PrivateKeyType.ACTIVE, "6ABwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));
privateKeys.add(new ImmutablePair<>(PrivateKeyType.OWNER, "7ABwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"));

myConfig.getPrivateKeyStorage().addAccount(new AccountName("steemj"), privateKeys);

Code Quality

As always, here is a report about the current code quality of SteemJ.


SonarQube

This release adds some additional tests once again and we finally reached a code coverage of 60%.

Change Log

Below you can find all changes made in this release.

Functional Updates

  • The following issues have been fixed:
    • #51 Parsing Error for PowOperation.
    • #52 AccountName allowed uppercase letters.
    • #50 Change default Charset to UTF-8.
    • #56 Handle private keys of different users.
    • Partially fix #55 CustomOperation do not work.
      • CustomJsonOperation has been fixed so it is finally possible to follow/unfollow other accounts and to reblog posts with SteemJ.
      • CustomOperation pending
      • CustomBinaryOperation pending

Code Quality Improvements

  • Additional integration tests have been added.

Documentation

Future Plans

This section is used to share the thoughts about upcoming versions with you. Due to the bigger changes in this release I expect a third bugfix release (0.3.3). After that release the plans are to create a version 0.4.0 which comes with a TransactioBuilder that should increase the usability a lot by providing simple methods to:

  • Post
  • Comment
  • Vote
  • Unvote
  • Downvote
  • Follow
  • Unfollow
  • Reblog
  • ...

General information

What is SteemJ?

SteemJ is a project that allows you to communicate with a Steem node using Java. So far, the project supports most of the API calls and is also able to broadcast most of the common operation types. Further information can be found on GitHub.

https://github.com/marvin-we/steem-java-api-wrapper

How to add it to your project?

SteemJ binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven. The Wiki provides a lot of examples for the most common build tools. If you do not use a build management tool you can download the binaries as described here.

Contribute

The project became quite big and there is still a lot to do. If you want to support the project simply clone the git repository and submit a pull request. I would really appreciate it =).

git clone https://github.com/marvin-we/steem-java-api-wrapper.git

Get in touch!

Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on Steemit or ping me on GitHub.


If you want to stay up to date or just like the stuff I am doing it would be great if you could press the button below =).



follow me

Thanks for reading and best regards,
@dez1337

Sort:  

well done! dez1337!!
Thank you all the time.

Thanks for the support 😄

Awesome! Goodnews for steemit newbies 😊

Congratulations @dez1337! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Coin Marketplace

STEEM 0.20
TRX 0.19
JST 0.034
BTC 88275.41
ETH 3281.06
USDT 1.00
SBD 3.00