I need a code for 'aptos' js npm module to get the address from a privatekey.
I have the next code to get the address from a PublicKey:
const { HexString, TxnBuilderTypes } = require("aptos")
let pubKey = "ee23b459bbc3619caa0b978bdfa89551b04c62cd9b7fdb669a398c93d68730e8"
let key = HexString.ensure(pubKey).toUint8Array();
pubKey = new TxnBuilderTypes.Ed25519PublicKey(key)
const authKey = TxnBuilderTypes.AuthenticationKey.fromEd25519PublicKey(pubKey)
console.log(authKey.derivedAddress())
I need one of this two codes.
a) A similar code to get the address from PrivateKey.
b) A code to get the PublicKey from PrivateKey.
Thanks.