cmditch / elm-ethereum

dApps in Elm
https://package.elm-lang.org/packages/cmditch/elm-ethereum/1.0.1/
BSD 3-Clause "New" or "Revised" License
146 stars 21 forks source link

LightBox Example Dapp #9

Closed cmditch closed 7 years ago

cmditch commented 7 years ago

Decent basic UI example. Works with metamask on testnet and ropsten (probably mainnet).

Native.Web3.js is getting tricky. Dealing with all the Metamask failure cases has led to some verbose error catching logic. Trying to stay as Elm as possible - everything throw is caught and handled accordingly.

Regarding BigNumbers: Added a 'formatter function' in the toTask (general function) response handling. JSON.stringify was not properly converting BigNumbers to string past a certain threshold. BigNumber.toFixed() is needed. Luckily only a few return values in web3.js include BigNums.