// Check if the desired handle is available
const handle = 'userInputAlias';
const isAvailableHandle = await walletService.isAliasAvailable(handle);
if (!isAvailableHandle) {
throw new Error('Handle is not available');
}
// Create new wallet
await walletService.createWalletAccount(keyPair.publicKey, email, handle);
// Store the authentication key in a secure place so the user can access the wallet later
await storeAuthenticationKey(keyPair.privateKey);
// Get access to the new wallet
const account = walletService.getWalletAccountFromAuthToken(keyPair.privateKey);