createNew static method
Creates a Keystore V3 wallet JSON from the credentials.
Implementation
static Future<String> createNew(
Credentials credentials,
String password,
Random random, {
bool useScrypt = true,
int? n,
int? r,
int? p,
}) async {
final pk = credentials.privateKey;
final address = credentials.address.hex;
final json = crypto.KeystoreV3.encrypt(
pk,
password,
useScrypt: useScrypt,
address: address,
n: n,
r: r,
p: p,
);
return jsonEncode(json);
}