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

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

1 Like

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.

2 Likes

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)?

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

1 Like