@@ -28,7 +28,7 @@ import 'package:web3dart/web3dart.dart';
28
28
Credentials fromHex = EthPrivateKey.fromHex("c87509a[...]dc0d3");
29
29
30
30
// Or generate a new key randomly
31
- var rng = new Random.secure();
31
+ var rng = Random.secure();
32
32
Credentials random = EthPrivateKey.createRandom(random)(rng);
33
33
34
34
// In either way, the library can derive the public key and the address
@@ -45,7 +45,7 @@ support for version 3 wallets commonly generated by other Ethereum clients:
45
45
import 'dart:io';
46
46
import 'package:web3dart/web3dart.dart';
47
47
48
- String content = new File("wallet.json").readAsStringSync();
48
+ String content = File("wallet.json").readAsStringSync();
49
49
Wallet wallet = Wallet.fromJson(content, "testpassword");
50
50
51
51
Credentials unlocked = wallet.privateKey;
@@ -80,8 +80,8 @@ import 'package:web3dart/web3dart.dart';
80
80
81
81
var apiUrl = "http://localhost:7545"; //Replace with your API
82
82
83
- var httpClient = new Client();
84
- var ethClient = new Web3Client(apiUrl, httpClient);
83
+ var httpClient = Client();
84
+ var ethClient = Web3Client(apiUrl, httpClient);
85
85
86
86
var credentials = ethClient.credentialsFromPrivateKey("0x...");
87
87
@@ -98,7 +98,7 @@ transactions:
98
98
import 'package:web3dart/web3dart.dart';
99
99
100
100
/// [...], you need to specify the url and your client, see example above
101
- var ethClient = new Web3Client(apiUrl, httpClient);
101
+ var ethClient = Web3Client(apiUrl, httpClient);
102
102
103
103
var credentials = ethClient.credentialsFromPrivateKey("0x...");
104
104
0 commit comments