forked from jsnbuchanan/crowd-funder-for-time-pwa
WIP: BROKEN FOR ELECTRON: Fixes in progress
This commit is contained in:
@@ -30,19 +30,13 @@ import {
|
||||
simpleEncrypt,
|
||||
} from "../libs/crypto";
|
||||
import * as serverUtil from "../libs/endorserServer";
|
||||
import {
|
||||
containsHiddenDid,
|
||||
} from "../libs/endorserServer";
|
||||
import { containsHiddenDid } from "../libs/endorserServer";
|
||||
import {
|
||||
GenericCredWrapper,
|
||||
GenericVerifiableCredential,
|
||||
} from "../interfaces/common";
|
||||
import {
|
||||
GiveSummaryRecord,
|
||||
} from "../interfaces/records";
|
||||
import {
|
||||
OfferVerifiableCredential,
|
||||
} from "../interfaces/claims";
|
||||
import { GiveSummaryRecord } from "../interfaces/records";
|
||||
import { OfferVerifiableCredential } from "../interfaces/claims";
|
||||
import { KeyMeta } from "../interfaces/common";
|
||||
import { createPeerDid } from "../libs/crypto/vc/didPeer";
|
||||
import { registerCredential } from "../libs/crypto/vc/passkeyDidPeer";
|
||||
@@ -406,10 +400,7 @@ export function offerGiverDid(
|
||||
export const canFulfillOffer = (
|
||||
veriClaim: GenericCredWrapper<GenericVerifiableCredential>,
|
||||
) => {
|
||||
return (
|
||||
veriClaim.claimType === "Offer" &&
|
||||
!!offerGiverDid(veriClaim)
|
||||
);
|
||||
return veriClaim.claimType === "Offer" && !!offerGiverDid(veriClaim);
|
||||
};
|
||||
|
||||
// return object with paths and arrays of DIDs for any keys ending in "VisibleToDid"
|
||||
@@ -478,8 +469,10 @@ export function findAllVisibleToDids(
|
||||
*
|
||||
**/
|
||||
|
||||
export interface AccountKeyInfo extends Omit<Account, 'derivationPath'>, Omit<KeyMeta, 'derivationPath'> {
|
||||
derivationPath?: string; // Make it optional to match Account type
|
||||
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> => {
|
||||
@@ -489,7 +482,7 @@ export const retrieveAccountCount = async (): Promise<number> => {
|
||||
`SELECT COUNT(*) FROM accounts`,
|
||||
);
|
||||
if (dbResult?.values?.[0]?.[0]) {
|
||||
result = dbResult.values[0][0] as number;
|
||||
result = dbResult.values[0][0] as number;
|
||||
}
|
||||
|
||||
if (USE_DEXIE_DB) {
|
||||
@@ -638,7 +631,7 @@ export const retrieveAllFullyDecryptedAccounts = async (): Promise<
|
||||
) as unknown as AccountEncrypted[];
|
||||
if (USE_DEXIE_DB) {
|
||||
const accountsDB = await accountsDBPromise;
|
||||
allAccounts = await accountsDB.accounts.toArray() as AccountEncrypted[];
|
||||
allAccounts = (await accountsDB.accounts.toArray()) as AccountEncrypted[];
|
||||
}
|
||||
return allAccounts;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user