Browse Source

fix: resolve type conflicts in AccountKeyInfo and KeyMeta imports

- Update AccountKeyInfo interface to handle derivationPath type conflict
- Fix circular dependency by importing KeyMeta directly from interfaces/common
- Use Omit utility type to properly merge Account and KeyMeta types
- Make derivationPath optional in AccountKeyInfo to match Account type

This change resolves type compatibility issues while maintaining
the intended functionality of account metadata handling.
pull/137/head
Matthew Raymer 1 week ago
parent
commit
cea0456148
  1. 3
      src/libs/endorserServer.ts
  2. 6
      src/libs/util.ts

3
src/libs/endorserServer.ts

@ -37,7 +37,8 @@ import {
retrieveFullyDecryptedAccount,
getPasskeyExpirationSeconds,
} from "../libs/util";
import { createEndorserJwtForKey, KeyMeta } from "../libs/crypto/vc";
import { createEndorserJwtForKey } from "../libs/crypto/vc";
import { KeyMeta } from "../interfaces/common";
import {
GenericCredWrapper,

6
src/libs/util.ts

@ -43,7 +43,7 @@ import {
import {
OfferVerifiableCredential,
} from "../interfaces/claims";
import { KeyMeta } from "../libs/crypto/vc";
import { KeyMeta } from "../interfaces/common";
import { createPeerDid } from "../libs/crypto/vc/didPeer";
import { registerCredential } from "../libs/crypto/vc/passkeyDidPeer";
import { logger } from "../utils/logger";
@ -478,7 +478,9 @@ export function findAllVisibleToDids(
*
**/
export interface AccountKeyInfo extends Account, KeyMeta {}
export interface AccountKeyInfo extends Omit<Account, 'derivationPath'>, Omit<KeyMeta, 'derivationPath'> {
derivationPath?: string; // Make it optional to match Account type
}
export const retrieveAccountCount = async (): Promise<number> => {
let result = 0;

Loading…
Cancel
Save