diff --git a/docs/callbacks-promises-events.rst b/docs/callbacks-promises-events.rst index ac6e45e..3a5a39d 100644 --- a/docs/callbacks-promises-events.rst +++ b/docs/callbacks-promises-events.rst @@ -5,18 +5,18 @@ Callbacks Promises Events To help web3 integrate into all kind of projects with different standards we provide multiple ways to act on asynchronous functions. -Most web3.js objects allow a callback as the last parameter, as well as return a promise to chain funcitons. +Most web3.js objects allow a callback as the last parameter, as well as returning promises to chain functions. Ethereum as a blockchain has different level of finality and therefore we return for some functions, like ``web3.eth.sendTransaction`` or contract methods a "promiEvent". This is a promise combined with an event emitter. -This promiEvent works like a normal promise with added ``on`` functions to watch for additional events like "receipt" or "transactionHash" +This promiEvent works like a normal promise with added ``on`` and ``once`` functions to watch for additional events like "receipt" or "transactionHash" .. code-block:: javascript web3.eth.sendTransaction({from: '0x123...', data: '0x432...'}) - .on('transactionHash', function(hash){ ... }) - .on('receipt', function(receipt){ ... }) + .once('transactionHash', function(hash){ ... }) + .once('receipt', function(receipt){ ... }) .then(function(receipt){ // will be fired once the receipt its mined }); diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index ccfb30d..9248c50 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -1,10 +1,10 @@ -############### +======== web3.eth -############### +======== Some text web3.version -************** +============ XYZ diff --git a/docs/web3.rst b/docs/web3.rst new file mode 100644 index 0000000..b5c6864 --- /dev/null +++ b/docs/web3.rst @@ -0,0 +1,26 @@ +==== +web3 +==== + +The web3.js object is a container object to house all ethereum related modules. + + +web3.version +============ + +Contains the version of the web3.js container object. + +------- +Returns +------- + +``String`` - The version of the web3.js container object + +------- +Example +------- + +.. code-block:: javascript + + web3.version; + > "1.0.0"