Web3 incorporates the BigNumber library in order to handle 256bit numbers.

I'm finding this problematic in Meteor as most of Meteor's reactive storage schemes such as Session, ReactiveDict and collections render BigNumber objects as simple JSON objects, thereby losing all the BigNumber functionality. ReactiveVar has no such problem and preserves type.

Meteor can preserve object types as EJSON but requires that the object have a custom toEJSON() function and a factory function added to the EJSON module for the custom type.

I haven't seen such coding for EJSON in the few DAPP examples around and am wondering how others are getting around such problems with BigNumber reactivity and storage?

For example, how does one display BigNumber from blockchain events which get stored in a Meteor collection as simple Objects?

amount: Object
c: Array[1]
e: 3
s: 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.