Skip to main content

generateAccount

Generates a new account in the wallet.

Usage

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.generateAccount('Personal');

console.log(account);
/*
{
address: 'SH2KEL633QIJLURBOOJTIKR5EIIYR4A2VYZC2DB6ZD4ZZL6XHYFBETEOGU',
name: 'Personal',
}
*/

Parameters

name (optional)

  • Type: string
  • Default: undefined

A name for the account.

Returns

Promise<Account>

A promise that resolves to the generated account.

Throws

EncryptionError

If the account's private key failed to be encrypted.

NotAuthenticatedError

If the provider has not been authenticated.