I want to use power of Eth to enable payment and some rpc related operations to my app. Which version(1.0 beta or 0.+) of webjs I need to use. May I know why?
You don't have to move to the new version if you don't have any issues with the one you are currently using. The new web3 1.0 version is still in beta and there is no official release date yet so there is no need to upgrade.
Some important changes of the new version include:
- Events - changed the way we listen to Smart Contract Events.
- HttpProvider is no longer supported for events.
- WebsocketProvider is the web3 1.0 way of listening to events via subscribe/unsubscribe
- Returns - majority of the returns have been converted into Promises. Additionally previous functions that returned
BigNumberare now returning a
Stringrepresentation of that number.
- Utilities - utility functions (
toWei, etc.) have been moved into a
- Modularization - a lot of refactoring has been made to decouple the web3 modules and make it possible to use them individually.
If you want to know if any specific functionality has been changed you can find more on their wiki page: web3.js 1.0 documentation
Te web3js version 1.0 is actually better than the old version and feels more modern and much more intuitive. The semantics of the methods are basically the same between the 2 versions but the declarations, output, and input of each method has changed a lot. If you are already using the 0.x version, just keep using it. If you didn't start with web3 yet, go to version 1.0.
NOTE : You may not find many tutorials to start with on version 1.0 since it is not that stable, yet.