As far as I understand, we should use the second one (v2), but this doen’t seem possible because you can only sign a transaction using the first one.
Am I missing something?
Are they intended to have different use cases?
If so, since they have the same name, it’s a bit annoying and confusing in Java to have to handle both because it forces you to use the extended class name (i.e. com.algorand.algosdk.v2.client.model.Account) to refere to the correct “Account”.
What is your opinion on this? Do you have any suggestions?
We really need to change this, but the com.algorand.algosdk.v2.client.model.Account is used with rest calls. The com.algorand.algosdk.account.Account class is used for signing and other things (multisigs etc) that can be done on or offline.
The first one represents an Account you can use to sign transactions with (the simplest case being just a secret signature key). If you want to sign and send transactions, that’s what you want to use.
Unfortunately it’s confusing (and annoying while coding) that they have the same name… but I think it would be too difficult now to change the SDK to resolve this homonymy.
Perhaps I could propose to encapsulate one of the classes in another one with a different name…
Do you see any other solution?