This commit is contained in:
Ethan Frey 2020-02-10 16:28:57 +01:00
parent b047658af3
commit 1bea452fbc

View File

@ -86,3 +86,9 @@ const executeContract = async (execClient: RestClient, execPen: Secp256k1Pen, co
return execLogs;
}
const randomAddress = async (): Promise<string> => {
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const randomPen = await Secp256k1Pen.fromMnemonic(mnemonic);
const pubkey = encodeSecp256k1Pubkey(randomPen.pubkey);
return encodeAddress(pubkey, "cosmos");
}