diff --git a/project.yaml b/project.yaml index b6ed7a2..7cfc3cd 100644 --- a/project.yaml +++ b/project.yaml @@ -24,6 +24,8 @@ - get 'copy' to work on account page - contacts v+ : + - .2 warn about amounts when you cannot see them + - .2 confirmed direction is wrong on ContactAmounts screen - .5 make advanced "show/hide amounts" button into a nice UI toggle - .2 show error to user when adding a duplicate contact - parse input more robustly (with CSV lib and not commas) diff --git a/src/db/tables/accounts.ts b/src/db/tables/accounts.ts index 9602439..b42e55a 100644 --- a/src/db/tables/accounts.ts +++ b/src/db/tables/accounts.ts @@ -2,6 +2,7 @@ export type Account = { id?: number; // auto-generated by Dexie dateCreated: string; derivationPath: string; + did: string; identity: string; publicKeyHex: string; mnemonic: string; @@ -11,5 +12,5 @@ export type Account = { // see https://github.com/PVermeer/dexie-addon-suite-monorepo/tree/master/packages/dexie-encrypted-addon export const AccountsSchema = { accounts: - "++id, dateCreated, derivationPath, $identity, $mnemonic, publicKeyHex", + "++id, dateCreated, derivationPath, did, $identity, $mnemonic, publicKeyHex", }; diff --git a/src/db/tables/settings.ts b/src/db/tables/settings.ts index 1da602a..a2233ec 100644 --- a/src/db/tables/settings.ts +++ b/src/db/tables/settings.ts @@ -1,6 +1,7 @@ // a singleton export type Settings = { - id: number; + id: number; // there's only one entry: MASTER_SETTINGS_KEY + activeDid?: string; firstName?: string; lastName?: string; showContactGivesInline?: boolean; diff --git a/src/test/index.ts b/src/test/index.ts index fe593da..2403a9f 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -1,9 +1,10 @@ import axios from "axios"; import * as didJwt from "did-jwt"; import { AppString } from "@/constants/app"; -import { accountsDB } from "../db"; +import { db } from "../db"; import { SERVICE_ID } from "../libs/veramo/setup"; import { deriveAddress, newIdentifier } from "../libs/crypto"; +import { MASTER_SETTINGS_KEY } from "@/db/tables/settings"; export async function testServerRegisterUser() { const testUser0Mnem = @@ -13,9 +14,8 @@ export async function testServerRegisterUser() { const identity0 = newIdentifier(addr, publicHex, privateHex, deriPath); - await accountsDB.open(); - const accounts = await accountsDB.accounts.toArray(); - const thisIdentity = JSON.parse(accounts[0].identity); + await db.open(); + const settings = await db.settings.get(MASTER_SETTINGS_KEY); // Make a claim const vcClaim = { @@ -23,7 +23,7 @@ export async function testServerRegisterUser() { "@type": "RegisterAction", agent: { did: identity0.did }, object: SERVICE_ID, - participant: { did: thisIdentity.did }, + participant: { did: settings?.activeDid }, }; // Make a payload for the claim const vcPayload = { @@ -56,5 +56,5 @@ export async function testServerRegisterUser() { }; const resp = await axios.post(url, payload, { headers }); - console.log("Result:", resp); + console.log("User registration result:", resp); } diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 243cc46..7546589 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -240,8 +240,11 @@