WavesJ: Waves + Java library

In case some of you aren’t aware: we have a Java library to help sign Waves transactions and interact with nodes: WavesJ.

Github page: https://github.com/wavesplatform/WavesJ/ . It has some usage examples.
Maven repository page: https://mvnrepository.com/artifact/com.wavesplatform/wavesj

I’m now adding support for newest features such as scripts, base64, and string data entries.

Ideas and pull requests are welcome!

2 Likes

If I remember well it was impossible to look up tx and blocks with it, right?
If so, this would be good to add.

The problem with tx is we have 10+ types of them, so we have to either define a class for each one or lose type safety. There’s probably nothing wrong with defining new classes however. It’s just lots of typing =)

If I find time next month after graduating I will see to maybee do some work.
I think I have for most tx type’s already a rougly made class since I need those in my bot

I’ve realized that I can reuse current Transaction class which is basically a bag of values. So I’ve added getBlock(height), getBlock(id), and getTransaction(id) to Node.

1 Like

Great :smiley:
I can almost throw out my custom api-wrapper :stuck_out_tongue:

Version 0.7 is out complete with:

  • Support for account scripts
  • Node.getBlock() and Node.getTransaction()
  • All factory methods in Transaction class got overrides that accept timestamp parameter
  • String entries in Data transactions
1 Like

Published version 0.8 yesterday. Changes are:

  • Support for transactions version 2 (compatible with Waves 0.13 with the Smart Accounts feature activated)
  • Transaction.setProof() was renamed withProof() to better reflect the fact that it doesn’t modify the object but rather returns new one
  • char PublicKeyAccount.scheme was replaced with byte chainId
  • Introduced Transaction.getBytes()
1 Like

Nice updates, but don’t we need everything backwards compatible for as long as possible?
I have updated my code now, but in the past I noticed people that became confused after not being able to use latest update with there old code.

Seems it break compatibility with other waves versions tho?
Also it complains that V2 isnt activated yet, this means the library is atm broken

"message" : "State check failed. Reason: ActivationError(TransferTransactionV2 transaction has not been activated yet)",

v2 needs Smart Accounts feature to be activated, which is currently the case with testnet only. It seems I need to improve the wording in my announcement…

Not sure about compatibility, I still feel it’s too early to freeze the current API. Or maybe I should maintain two branches in parallel, one of which would be stable

I would suggest adding some kind of boolean to switch between old and new. Because I updated to the new one and had to rollback everything :smiley:

We made such switch in WavesCS library. You can check first line in this MultiSig test which requires TransferTransaction version 2. It sets static field and then it uses in TransferTransaction serialization logic.

1 Like

“error” : 112,
“message” : “State check failed. Reason: ActivationError(TransferTransactionV2 transaction has not been activated yet)”,

I got this error message when I transfer my token. How to solve it? Please help me!

So far v2 works on testnet only, pending smart accounts feature activation on mainnet. You can use either library version 0.7 or 0.10 – both support v1 transactions