Even though the code uses Bignum for manipulating arktoshi we have Bignum | number | string in the definitions of the classes. This is because the unit tests use fixtures/jsons that use numbers, e.g. amount: 123 instead of amount: "123".
The problem is that the amount of arktoshi could exceed JavaScript's Number.MAX_SAFE_INTEGER, so any chance of the code to accidentally start using native numbers should be nullified. Thus:
Change all Bignum | number | string to Bignum | string and adjust the fixtures.
Even though the code uses Bignum for manipulating arktoshi we have
Bignum | number | string
in the definitions of the classes. This is because the unit tests use fixtures/jsons that use numbers, e.g.amount: 123
instead ofamount: "123"
.The problem is that the amount of arktoshi could exceed JavaScript's
Number.MAX_SAFE_INTEGER
, so any chance of the code to accidentally start using native numbers should be nullified. Thus:Change all
Bignum | number | string
toBignum | string
and adjust the fixtures.