Skip to content

Commit

Permalink
Merge branch '1.0' into deprecated-compiler-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
frozeman committed Aug 17, 2018
2 parents 6540aaf + d1eb4d1 commit 30a02ba
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 40 deletions.
156 changes: 136 additions & 20 deletions docs/web3-eth-ens.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Example

.. code-block:: javascript
web3.eth.ens.resolver(name).then(function (contract) {
web3.eth.ens.resolver('ethereum.eth').then(function (contract) {
console.log(contract);
});
> Contract<Resolver>
Expand Down Expand Up @@ -108,15 +108,15 @@ setAddress

.. code-block:: javascript
web3.eth.ens.setAddress(name, address, options);
web3.eth.ens.setAddress(ENSName, address, options);
Sets the address of an ENS name in his resolver.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.
2. ``address`` - ``String``: The address to set.
3. ``options`` - ``Object``: The options used for sending.
* ``from`` - ``String``: The address the transaction should be sent from.
Expand Down Expand Up @@ -162,22 +162,40 @@ Example
})
.on('error', console.error);
// Or listen to the AddrChanged event on the resolver
web3.eth.ens.resolver('ethereum.eth').then(function (resolver) {
resolver.events.AddrChanged({fromBlock: 0}, function(error, event) {
console.log(event);
})
.on('data', function(event){
console.log(event);
})
.on('changed', function(event){
// remove event from local database
})
.on('error', console.error);
});
For further information on the handling of contract events please see here contract-events_.
------------------------------------------------------------------------------

getPubkey
=====================

.. code-block:: javascript
web3.eth.ens.getPubkey(name);
web3.eth.ens.getPubkey(ENSName);
Returns the X and Y coordinates of the curve point for the public key.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.

-------
Returns
Expand Down Expand Up @@ -208,15 +226,15 @@ setPubkey

.. code-block:: javascript
web3.eth.ens.setPubkey(name, x, y, options);
web3.eth.ens.setPubkey(ENSName, x, y, options);
Sets the SECP256k1 public key associated with an ENS node

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.
2. ``x`` - ``String``: The X coordinate of the public key.
3. ``y`` - ``String``: The Y coordinate of the public key.
4. ``options`` - ``Object``: The options used for sending.
Expand Down Expand Up @@ -266,22 +284,40 @@ Example
})
.on('error', console.error);
// Or listen to the PubkeyChanged event on the resolver
web3.eth.ens.resolver('ethereum.eth').then(function (resolver) {
resolver.events.PubkeyChanged({fromBlock: 0}, function(error, event) {
console.log(event);
})
.on('data', function(event){
console.log(event);
})
.on('changed', function(event){
// remove event from local database
})
.on('error', console.error);
});
For further information on the handling of contract events please see here contract-events_.
------------------------------------------------------------------------------

getContent
=====================

.. code-block:: javascript
web3.eth.ens.getContent(name);
web3.eth.ens.getContent(ENSName);
Returns the content hash associated with an ENS node.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.

-------
Returns
Expand All @@ -307,15 +343,15 @@ setContent

.. code-block:: javascript
web3.eth.ens.setContent(name, hash, options);
web3.eth.ens.setContent(ENSName, hash, options);
Sets the content hash associated with an ENS node.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.
2. ``hash`` - ``String``: The content hash to set.
3. ``options`` - ``Object``: The options used for sending.
* ``from`` - ``String``: The address the transaction should be sent from.
Expand Down Expand Up @@ -362,22 +398,40 @@ Example
})
.on('error', console.error);
// Or listen to the ContentChanged event on the resolver
web3.eth.ens.resolver('ethereum.eth').then(function (resolver) {
resolver.events.ContentChanged({fromBlock: 0}, function(error, event) {
console.log(event);
})
.on('data', function(event){
console.log(event);
})
.on('changed', function(event){
// remove event from local database
})
.on('error', console.error);
});
For further information on the handling of contract events please see here contract-events_.
------------------------------------------------------------------------------

getMultihash
=====================

.. code-block:: javascript
web3.eth.ens.getMultihash(name);
web3.eth.ens.getMultihash(ENSName);
Returns the multihash associated with an ENS node.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.

-------
Returns
Expand All @@ -403,15 +457,15 @@ setMultihash

.. code-block:: javascript
web3.eth.ens.setMultihash(name, hash, options);
web3.eth.ens.setMultihash(ENSName, hash, options);
Sets the multihash associated with an ENS node.

----------
Parameters
----------

1. ``name`` - ``String``: The ENS name.
1. ``ENSName`` - ``String``: The ENS name.
2. ``hash`` - ``String``: The multihash to set.
3. ``options`` - ``Object``: The options used for sending.
* ``from`` - ``String``: The address the transaction should be sent from.
Expand Down Expand Up @@ -458,6 +512,9 @@ Example
})
.on('error', console.error);
For further information on the handling of contract events please see here contract-events_.
------------------------------------------------------------------------------
ENS events
Expand All @@ -481,9 +538,39 @@ Example
.. code-block:: javascript
web3.eth.ens.resolver(name).then(function (contract) {
contract.events.AddrChange(options, callback);
web3.eth.ens.resolver('ethereum.eth').then(function (resolver) {
resolver.events.AddrChanged({fromBlock: 0}, function(error, event) {
console.log(event);
})
.on('data', function(event){
console.log(event);
})
.on('changed', function(event){
// remove event from local database
})
.on('error', console.error);
});
> {
returnValues: {
node: '0x123456789...',
a: '0x123456789...',
},
raw: {
data: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',
topics: [
'0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
'0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385'
]
},
event: 'AddrChanged',
signature: '0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
logIndex: 0,
transactionIndex: 0,
transactionHash: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',
blockHash: '0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
blockNumber: 1234,
address: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'
}
------------
Known registry events
Expand All @@ -500,10 +587,39 @@ Example
.. code-block:: javascript
web3.eth.ens.resistry.then(function (contract) {
contract.events.Transfer(options, callback);
web3.eth.ens.resistry.then(function (registry) {
registry.events.Transfer({fromBlock: 0}, , function(error, event) {
console.log(event);
})
.on('data', function(event){
console.log(event);
})
.on('changed', function(event){
// remove event from local database
})
.on('error', console.error);
});
> {
returnValues: {
node: '0x123456789...',
owner: '0x123456789...',
},
raw: {
data: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',
topics: [
'0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
'0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385'
]
},
event: 'Transfer',
signature: '0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
logIndex: 0,
transactionIndex: 0,
transactionHash: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',
blockHash: '0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',
blockNumber: 1234,
address: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'
}
For further information on the handling of contract events please see here contract-events_.
Expand Down
26 changes: 16 additions & 10 deletions docs/web3-eth-subscribe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Example
topics: ['0x12345...']
}, function(error, result){
if (!error)
console.log(log);
console.log(result);
});
// unsubscribes the subscription
Expand Down Expand Up @@ -132,17 +132,15 @@ Returns

``EventEmitter``: An :ref:`subscription instance <eth-subscription-return>` as an event emitter with the following events:

- ``"data"`` returns ``Object``: Fires on each incoming pending transaction.
- ``"data"`` returns ``String``: Fires on each incoming pending transaction and returns the transaction hash.
- ``"error"`` returns ``Object``: Fires when an error in the subscription occurs.

For the structure of the returned object see :ref:`web3.eth.getTransaction() return values <eth-gettransaction-return>`.

----------------
Notification returns
----------------

1. ``Object|Null`` - First parameter is an error object if the subscription failed.
2. ``Object`` - The block header object like above.
2. ``String`` - Second parameter is the transaction hash.

-------
Example
Expand Down Expand Up @@ -204,7 +202,7 @@ The structure of a returned block header is as follows:
- ``logsBloom`` 256 Bytes - ``String``: The bloom filter for the logs of the block. ``null`` when its pending block.
- ``transactionsRoot`` 32 Bytes - ``String``: The root of the transaction trie of the block
- ``stateRoot`` 32 Bytes - ``String``: The root of the final state trie of the block.
- ``receiptRoot`` 32 Bytes - ``String``: The root of the receipts.
- ``receiptsRoot`` 32 Bytes - ``String``: The root of the receipts.
- ``miner`` - ``String``: The address of the beneficiary to whom the mining rewards were given.
- ``extraData`` - ``String``: The "extra data" field of this block.
- ``gasLimit`` - ``Number``: The maximum gas allowed in this block.
Expand All @@ -226,16 +224,24 @@ Example
.. code-block:: javascript
var subscription = web3.eth.subscribe('newBlockHeaders', function(error, result){
if (error)
console.log(error);
if (!error) {
console.log(result);
return;
}
console.error(error);
})
.on("data", function(blockHeader){
});
console.log(blockHeader);
})
.on("error", console.error);
// unsubscribes the subscription
subscription.unsubscribe(function(error, success){
if(success)
if (success) {
console.log('Successfully unsubscribed!');
}
});
------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/web3-eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ Returns

``Promise`` returns ``Object`` - A transaction receipt object, or ``null`` when no receipt was found:

- ``status`` - ``Boolean``: ``TRUE`` if the transaction was susccessfull, ``FALSE``, if the EVM reverted the transaction.
- ``status`` - ``Boolean``: ``TRUE`` if the transaction was successful, ``FALSE``, if the EVM reverted the transaction.
- ``blockHash`` 32 Bytes - ``String``: Hash of the block where this transaction was in.
- ``blockNumber`` - ``Number``: Block number where this transaction was in.
- ``transactionHash`` 32 Bytes - ``String``: Hash of the transaction.
Expand Down
2 changes: 1 addition & 1 deletion docs/web3-utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ unitMap
Shows all possible `ether value <http://ethdocs.org/en/latest/ether.html>`_ and their amount in `wei <http://ethereum.stackexchange.com/questions/253/the-ether-denominations-are-called-finney-szabo-and-wei-what-who-are-these-na>`_.

----------
Retrun value
Return value
----------

- ``Object`` with the following properties:
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,9 @@ HttpProvider.prototype.send = function (payload, callback) {
}
};

HttpProvider.prototype.disconnect = function () {
//NO OP
}


module.exports = HttpProvider;
Loading

0 comments on commit 30a02ba

Please sign in to comment.