Skip to content

Commit

Permalink
Merge pull request #2931 from Skyge/2.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 8577138 + 19343b2 commit 53d0544
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 @@ -1064,8 +1064,8 @@ Example
.. code-block:: javascript
const Tx = require('ethereumjs-tx');
const privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex')
const Tx = require('ethereumjs-tx').Transaction;
const privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex')
const rawTx = {
nonce: '0x00',
Expand All @@ -1076,7 +1076,7 @@ Example
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057'
}
const tx = new Tx(rawTx);
const tx = new Tx(rawTx, {'chain':'ropsten'});
tx.sign(privateKey);
const serializedTx = tx.serialize();
Expand All @@ -1089,6 +1089,8 @@ Example
> // see eth.getTransactionReceipt() for details
.. note:: When use the package `ethereumjs-tx` at the version of `2.x`, 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.
------------------------------------------------------------------------------
sign
Expand Down

0 comments on commit 53d0544

Please sign in to comment.