export type Account = {
  id?: number; // auto-generated by Dexie
  dateCreated: string;
  derivationPath: string;
  did: string;
  // stringified JSON containing underlying key material of type IIdentifier
  // https://github.com/uport-project/veramo/blob/next/packages/core-types/src/types/IIdentifier.ts
  identity: string;
  publicKeyHex: string;
  mnemonic: string;
};

// mark encrypted field by starting with a $ character
// see https://github.com/PVermeer/dexie-addon-suite-monorepo/tree/master/packages/dexie-encrypted-addon
export const AccountsSchema = {
  accounts:
    "++id, dateCreated, derivationPath, did, $identity, $mnemonic, publicKeyHex",
};
