Skip to content

Commit

Permalink
U Update the document of sendSignedTransaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyge committed Jul 3, 2019
1 parent 7655fe8 commit 43b11d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/web3-eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,8 @@ Example

.. code-block:: javascript
var Tx = require('ethereumjs-tx');
var privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex')
var Tx = require('ethereumjs-tx').Transaction;
var privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex');
var rawTx = {
nonce: '0x00',
Expand All @@ -1108,7 +1108,7 @@ Example
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057'
}
var tx = new Tx(rawTx);
var tx = new Tx(rawTx, {'chain':'ropsten'});
tx.sign(privateKey);
var serializedTx = tx.serialize();
Expand All @@ -1121,6 +1121,8 @@ Example
> // see eth.getTransactionReceipt() for details
.. note:: When use the package `ethereumjs-tx` at the version of `2.0.0`, if we don't specify the parameter `chain`, it will use `mainnet`, so if you wan to use at the other network, you should add this parameter `chain` to specify.


------------------------------------------------------------------------------

Expand Down

0 comments on commit 43b11d6

Please sign in to comment.