Atm, the way we convert from an absolute value to a relative value is using:
const relative = absoluteUint64.compact() / Math.pow(10, config.tokenDivisibility);
The absoluteUint64.compact() may fail if the absoluteUint64 is >= 2^53.
The compact is used because our native UInt64 doesn't have natives division or multiplication like we do have addition and subtraction.
Question, the TS SDK has a dependency to the "long" package.
https://github.com/nemtech/symbol-sdk-typescript-javascript/blob/main/package.json#L109
https://www.npmjs.com/package/long
Should we use the library instead of having our own custom Uint64? Why using both RawUInt64 and Long?
Atm, the way we convert from an absolute value to a relative value is using:
The
absoluteUint64.compact()may fail if the absoluteUint64 is >= 2^53.The compact is used because our native UInt64 doesn't have natives division or multiplication like we do have addition and subtraction.
Question, the TS SDK has a dependency to the "long" package.
https://github.com/nemtech/symbol-sdk-typescript-javascript/blob/main/package.json#L109
https://www.npmjs.com/package/long
Should we use the library instead of having our own custom Uint64? Why using both RawUInt64 and Long?