Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is it possible to retrieve the timestamp of a contract from the JSON API?Forum ↗

Is it possible to retrieve the timestamp of a contract from the JSON API?

App Development4 posts400 views4 likesLast activity Nov 2021
JA
jaypeedaOP
Nov 2021

Hi team,

In the Daml Navigator which uses gRPC api, I see that we can see the timestamp a contract that has been created.
But is it possible to retrieve the timestamp of a contract from the JSON API ? (With a flag or something?)

If not, is the recommended way would be to create a timestamp field and store the time with a getTime ?

Thanks and Regards,

Jean-Paul

CO
cocreature
Nov 2021

There is no way to get the timestamp of the created event via the JSON API atm. This limitation also applies to parts of the gRPC API see Contract creation time.

A field that you set to the result of getTime on creation seems very sensible. Keep in mind though that you have to trust the signatories of a contract to actually go through your choice instead of creating the contract directly. If they create it directly they can set the time to whatever they want.

JA
jaypeeda
Nov 2021

Noted with thanks. What would be the recommended way to have the timestamp of a contract by only using JSON API (which doesn’t listen to a transaction stream)?

CO
cocreature
Nov 2021

Your suggestion of adding a field is what I’d recommend.

← Back to Discussions