Skip to content

Commit

Permalink
Merge pull request #2914 from Skyge/1.x
Browse files Browse the repository at this point in the history
U Update the document of  `sendSignedTransaction`.
  • Loading branch information
nivida authored Aug 2, 2019
2 parents dabf89e + 81e5acd commit 21359d0
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 @@ -1094,8 +1094,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 @@ -1106,7 +1106,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 @@ -1119,6 +1119,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 21359d0

Please sign in to comment.