TransactionExpiry.toJSON
can fail if the internal bigint
is not a safe integer
#346
Labels
Breaking changes
Implementation of the issue will cause breaking changes.
[Project] js-sdk
[Type] Bug
Something isn't working
Bug Description
TransactionExpiry.toJSON
converts aTransactionExpiry
to anumber
as a serializable representation. However, aTransactionExpiry
is implemented as a number of seconds from the UNIX epoch as abigint
. Therefore, converting to anumber
can give imprecise results, e.g. one might not be able to convert back to aTransactionExpiry
.#336 makes the method explicitly throw if the internal
bigint
is outside the safe range, but ideally atoJSON
method should not throw errors.Solution
Converting to a
string
instead would fix the problem, but this is a breaking change.The text was updated successfully, but these errors were encountered: