diff --git a/project.task.yaml b/project.task.yaml index e8799f3..763acca 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -37,6 +37,7 @@ tasks: - .2 fix rate limit verbiage (with the new one-per-day allowance) assignee:trent - .2 move 'switch identity' to the advanced section - .1 remove the logic to exclude beforeId in list of plans after server has commit 26b25af605e715600d4f12b6416ed9fd7142d164 +- .2 in SeedBackupView, don't load the mnemonic and keep it in memory; only load it when they click "show" - Discuss whether the remaining tasks are worthwhile before MVP release. diff --git a/src/db/index.ts b/src/db/index.ts index 8091e5c..d39ea5e 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -28,12 +28,12 @@ type NonsensitiveTables = { * https://9to5answer.com/how-to-bypass-warning-unexpected-any-specify-a-different-type-typescript-eslint-no-explicit-any */ export type SensitiveDexie = BaseDexie & T; -export const accountsDB = new BaseDexie("KickStartAccounts") as SensitiveDexie; +export const accountsDB = new BaseDexie("TimeSafariAccounts") as SensitiveDexie; const SensitiveSchemas = Object.assign({}, AccountsSchema); export type NonsensitiveDexie = BaseDexie & T; -export const db = new BaseDexie("KickStart") as NonsensitiveDexie; +export const db = new BaseDexie("TimeSafari") as NonsensitiveDexie; const NonsensitiveSchemas = Object.assign({}, ContactsSchema, SettingsSchema); /** diff --git a/src/libs/crypto/index.ts b/src/libs/crypto/index.ts index fb75e20..b3600b4 100644 --- a/src/libs/crypto/index.ts +++ b/src/libs/crypto/index.ts @@ -7,6 +7,8 @@ import { HDNode } from "@ethersproject/hdnode"; import * as didJwt from "did-jwt"; import * as u8a from "uint8arrays"; +export const DEFAULT_ROOT_DERIVATION_PATH = "m/76798669'/0'/0'/0'"; + /** * * @@ -47,17 +49,17 @@ export const newIdentifier = ( */ export const deriveAddress = ( mnemonic: string, + derivationPath: string = DEFAULT_ROOT_DERIVATION_PATH, ): [string, string, string, string] => { - const UPORT_ROOT_DERIVATION_PATH = "m/7696500'/0'/0'/0'"; mnemonic = mnemonic.trim().toLowerCase(); const hdnode: HDNode = HDNode.fromMnemonic(mnemonic); - const rootNode: HDNode = hdnode.derivePath(UPORT_ROOT_DERIVATION_PATH); + const rootNode: HDNode = hdnode.derivePath(derivationPath); const privateHex = rootNode.privateKey.substring(2); // original starts with '0x' const publicHex = rootNode.publicKey.substring(2); // original starts with '0x' const address = rootNode.address; - return [address, privateHex, publicHex, UPORT_ROOT_DERIVATION_PATH]; + return [address, privateHex, publicHex, derivationPath]; }; /** diff --git a/src/router/index.ts b/src/router/index.ts index c524c1b..7ce59c4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -91,6 +91,14 @@ const routes: Array = [ /* webpackChunkName: "import-account" */ "../views/ImportAccountView.vue" ), }, + { + path: "/import-derive", + name: "import-derive", + component: () => + import( + /* webpackChunkName: "import-derive" */ "../views/ImportDerivedAccountView.vue" + ), + }, { path: "/new-edit-account", name: "new-edit-account", diff --git a/src/views/ImportAccountView.vue b/src/views/ImportAccountView.vue index ae3f0ac..52e9330 100644 --- a/src/views/ImportAccountView.vue +++ b/src/views/ImportAccountView.vue @@ -24,6 +24,24 @@ v-model="mnemonic" /> {{ mnemonic }} +

+ Advanced +

+
+ Enter a custom derivation path + + For previous uPort or Endorser users, + + click here to use that value. + +