Skip to content

Add "divide" and "multiple" to Uint64 #780

@fboucquez

Description

@fboucquez

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3 IssueLow severity cosmetic issues with minor inconvenience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions