WavesJ: Waves + Java library


#1

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

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


#3

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 =)


#4

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


#5

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.


#6

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


#7

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

#8

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()

#9

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.


#10

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)",


#11

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


#12

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:


#13

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.


#14

“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!


#15

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