File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,14 @@ These examples assume you are running bitcoinjs-lib in the browser.
4949
5050``` javascript
5151
52- key = new Bitcoin.ECKey ()
52+ key = Bitcoin .ECKey . makeRandom ()
5353
5454// Print your private key (a hex string)
5555console .log (key .toString ())
5656// => 8c112cf628362ecf4d482f68af2dbb50c8a2cb90d226215de925417aa9336a48
5757
5858// Print your public key (defaults to a Bitcoin address)
59- console .log (key .getPub () .getAddress ())
59+ console .log (key .pub .getAddress ())
6060// => 14bZ7YWde4KdRb5YN7GYkToz3EHVCvRxkF
6161```
6262
@@ -72,7 +72,7 @@ tx.addInput("aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31",
7272tx .addOutput (" 1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK" , 15000 )
7373
7474// Initialize a private key using hex
75- key = new Bitcoin.ECKey (" 8c112cf628362ecf4d482f68af2dbb50c8a2cb90d226215de925417aa9336a48" )
75+ key = Bitcoin .ECKey . fromHex (" 8c112cf628362ecf4d482f68af2dbb50c8a2cb90d226215de925417aa9336a48" )
7676
7777// Sign the first input with the new key
7878tx .sign (0 , key)
You can’t perform that action at this time.
0 commit comments