Convert Principal to Account Id in TypeScript on the Internet Computer Blockchain.
Just import the function getAccountId.
It takes the principal as a parameter and return the subaccount ID. You can sepcify the a second parameter with the ID you want to use.