Skip to content

feat: add timestamp#502

Merged
rpanic merged 4 commits intodevelopfrom
feat/add-timestamp-to-objects
Apr 21, 2026
Merged

feat: add timestamp#502
rpanic merged 4 commits intodevelopfrom
feat/add-timestamp-to-objects

Conversation

@stanlou
Copy link
Copy Markdown
Collaborator

@stanlou stanlou commented Apr 14, 2026

Related to 10

@stanlou stanlou requested a review from rpanic April 14, 2026 16:01
@stanlou stanlou requested review from rpanic and removed request for rpanic April 14, 2026 16:04
Comment thread CHANGELOG.md Outdated

### Added

- Added createdAt timestamp to transaction, block, batch and settlement models.[#502](https://github.com/proto-kit/framework/pull/502)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future - let's add these to the bottom of the list s.t. PR numbers are ascending

s: string;
};
isMessage: boolean;
createdAt?: Date;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Block, Batch and Settlement it makes sense to have a date - they are created at a specific point in time and that time has "meaning". Transactions only get their meaning by being included in a block and imo this should be the date we should in the explorer too.
Additionally, this date here can be freely set by the user the way it's implemented currently making it a bit though to rely on.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my suggestion would be to remove the createdAt from the transaction and only do it for block, batch, settlement. Then in the explorer we query the transaction's block and use that date

proof: JsonProof;
blockHashes: string[];
height: number;
createdAt: Date;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we think about making this a number and using Date.now()?
This would make serialization easier as it will not break the "json-serializable by default" property of these objects

@stanlou stanlou requested a review from rpanic April 21, 2026 17:27
@rpanic rpanic merged commit 32f368c into develop Apr 21, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants