Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Compatibity between daml java sdk and ledger apiForum ↗

Compatibity between daml java sdk and ledger api

App Development4 posts245 viewsLast activity Apr 2022
BR
brijg11OP
Apr 2022

HI
Is there an easy way to convert the CreatedEvent from javaapi to that in the ledger api.
https://docs.daml.com/app-dev/bindings-java/javadocs/com/daml/ledger/javaapi/data/CreatedEvent.html

https://docs.daml.com/app-dev/bindings-java/javadocs/com/daml/ledger/api/v1/EventOuterClass.CreatedEvent.html

I need to instantiate a specific Contract object but that requires the created event from java api but what I have is the created event from ledger api using transaction service.

CO
cocreature
Apr 2022

There is a toProto method to do the conversion CreatedEvent

ST
Stephen
Apr 2022

There’s also a fromProto static method defined on CreatedEvent, going the other direction, which might be what you want.

BR
brijg11
Apr 2022

Thanks both. This works.

← Back to Discussions