Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change timestamp type for ton-proof #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requests-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type TonProofItemReply = TonProofItemReplySuccess | TonProofItemReplyError;
type TonProofItemReplySuccess = {
name: "ton_proof";
proof: {
timestamp: string; // 64-bit unix epoch time of the signing operation (seconds)
timestamp: number; // 58-bit unix epoch time of the signing operation (seconds)
Copy link
Collaborator

@thekiba thekiba Sep 17, 2024

Choose a reason for hiding this comment

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

Suggested change
timestamp: number; // 58-bit unix epoch time of the signing operation (seconds)
timestamp: number; // 53-bit unix epoch time of the signing operation (seconds)

JavaScript's number type uses IEEE 754 double-precision floating-point, which has 53 bits of precision for integers. Timestamps beyond 53 bits can lose precision.

For more details, see the ECMAScript specification on number type: https://262.ecma-international.org/15.0/#sec-ecmascript-language-types-number-type

domain: {
lengthBytes: number; // AppDomain Length
value: string; // app domain name (as url part, without encoding)
Expand Down