I have a little Daml application that I am trying to deploy to Canton. I’m roughly following this Getting Started example code:
One major thing I am doing differently is that I am trying to use the Daml / Java bindings rather than the Scala bindings, because the Scala bindings are deprecated. (I’m fairly certain that the Getting Started example is using the Scala bindings, because the Daml translations in the example are using case class-like semantics. That said, it is not easy tracking down how and where these bindings were generated.)
I hit a problem in my code when I get to the line that is equivalent to this one from the Getting Started guide:
val iouTx = participant2.ledger_api.commands.submit_flat(Seq(bank), Seq(iouCreateCmd))
This submit_flat
method takes a sequence of com.daml.ledger.api.v1.commands.Command
, as can be seen here in the docs.
I track this com.daml.ledger.api.v1.commands.Command
class down to a ledger-api-scalapb
artifact with this search:
https://search.maven.org/search?q=fc:%20com.daml.ledger.api.v1.commands.Command
However, the Java bindings I have generated for my Daml templates have different command types. I initially get a com.daml.ledger.javaapi.data.CreateCommand
, and I am able to convert this into a com.daml.ledger.api.v1.CommandsOuterClass.CreateCommand
, but I’m not finding a way to get to a com.daml.ledger.api.v1.commands.Command
.
It sort of seems like parts of the Canton API are catering to the Scala bindings, even though they are deprecated. Is there a way I can get a com.daml.ledger.api.v1.commands.Command
out of my Java bindings so that I can continue along the path I am on? Should I take a step back and switch over to the Scala bindings? Is there some other approach I can take here?
Thanks!