generateCredentialAccount
Generates a credential account in the wallet. The credential account is an account derived from the user's credentials; for passkeys, this is the key material returned from the passkey; for passwords this is the combination of the username, password and hostname.
info
See here for further explanation on the processes involved to derive these accounts.
Usage
- main.ts
import { voi } from '@kibisis/chains';
import { type Account, createKatavault } from '@kibisis/katavault-core';
const katavault = await createKatavault({
chains: [voi],
});
let account: Account;
await katavault.authenticateWithPasskey({
user: {
name: 'Kibi',
username: 'kibi@kibis.is',
},
});
account = await katavault.generateCredentialAccount('Default');
console.log(account);
/*
{
address: 'SH2KEL633QIJLURBOOJTIKR5EIIYR4A2VYZC2DB6ZD4ZZL6XHYFBETEOGU',
name: 'Default',
}
*/
Parameters
name (optional)
- Type:
string
- Default:
undefined
A name for the account.
Returns
A promise that resolves to the generated credential account.
Throws
EncryptionError
If the account's private key failed to be encrypted.
NotAuthenticatedError
If the provider has not been authenticated.