Skip to content

Commit

Permalink
Update lib/algorand.encoder.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Michael J Feher <[email protected]>
  • Loading branch information
ehanoc and PhearZero authored Feb 10, 2025
1 parent e3e17e2 commit ab048d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/algorand.encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class AlgorandEncoder extends Encoder{
*/
static safeCastBigInt(value: number | bigint): bigint {
const bigIntValue = BigInt(value)
if (bigIntValue < Number.MIN_SAFE_INTEGER || bigIntValue > Number.MAX_SAFE_INTEGER) {
if (typeof value === "number" && (value < Number.MIN_SAFE_INTEGER || value > Number.MAX_SAFE_INTEGER)) {
throw new Error("Value is not within the safe integer range")
}
return bigIntValue
Expand Down

0 comments on commit ab048d4

Please sign in to comment.