Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

BigNumber configuration seems to rely on npm deduping #301

Closed
koirikivi opened this issue Dec 29, 2017 · 1 comment
Closed

BigNumber configuration seems to rely on npm deduping #301

koirikivi opened this issue Dec 29, 2017 · 1 comment
Assignees

Comments

@koirikivi
Copy link

koirikivi commented Dec 29, 2017

The shared BigNumber configuration in utils/src/bignumber_config.ts seems to configure whatever BigNumber is installed as a dependency for 0xproject/utils. Note that this is not necessarily the same BigNumber as the one used by the caller.

I recently ran into an issue where schema validation failed for API calls made by 0xproject/connect because the BigNumber used by connect wasn't configured correctly (Order salts were serialized in the exponential notation).

Running npm dedupe fixed the issue, so I'm inclined to believe that this was because the BigNumber that was configured by utils wasn't the same as the one used by connect.

Possible fixes:

  • Move bignumber from dependencies to peerDependencies in 0xproject/utils
  • Instead of having a bigNumberConfigs.configure method in utils, just configure and re-export BigNumber and import it from utils instead of bignumber.js in the other packages.

Related to #293

@dekz
Copy link
Member

dekz commented Jan 3, 2018

I like the idea of exporting a configured BigNumber in utils package.

@fabioberger thoughts on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants