How to fetch contract with contract id or key using GRPC java
- Joy_KOP
How to fetch contract with contract id or key using GRPC java
- stefanobaghino-da
EDIT: my answer is wrong, see the following one for the correct approach.
stefanobaghino-da:The Ledger API doesn’t expose endpoints to directly fetch a contract and as a consequence the Java bindings cannot do so either directly. The pattern usually followed to do so that of having a non-consuming choice that performs the fetch in your Daml model and invokes that choice using
CommandSubmissionClient.submitAndWaitForResult. - bernhard
Correction to @stefanobaghino-da 's reply: In Daml 2.5 we introduced two new API methods
GetEventsByContractIdandGetEventsByContractKeywhich allow you to query a contract by Id or Key. These are currently only exposed by the lower level gPRC bindings for Java, not the rx-java layer. See getEventsByContractKey - #2 by bernhard.See API reference docs here.