diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index e767a96..c3200e2 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -76,6 +76,12 @@ export const getCode = async (addr: string) => { return await provider.getCode(addr) } +export const getFromMemonic = (memonic: string, index: number) => { + const path = `m/44'/60'/0'/0/${index}` + const wallet = ethers.Wallet.fromMnemonic(memonic, path) + return wallet.privateKey +} + export const sendTransaction = async ({ data= '', gas='0x0', to='', from='', value='0x0', gasPrice='0x0'}: {to: string, from: string, data: string, value: string, gas: string, gasPrice: string}, gasEstimate: Promise | null = null, pGasPrice : Promise | null) => { diff --git a/src/views/AddAccount.vue b/src/views/AddAccount.vue index b51aa56..af37610 100644 --- a/src/views/AddAccount.vue +++ b/src/views/AddAccount.vue @@ -2,8 +2,8 @@ - Add Account - Edit Account + Add Account + Edit Account @@ -13,199 +13,308 @@ - Get Random Name - Generate + Get Random Name + Generate - + PK - - Get Random PK - Generate - + Cancel - {{ isEdit ? 'Edit Account' : 'Add Account' }} + {{ + isEdit ? "Edit Account" : "Add Account" + }} + :is-open="alertOpen" + header="Error" + :message="alertMsg" + :buttons="['OK']" + @didDismiss="alertOpen = false" + > + + + + + + Close + + Extract PK from mnemonic + + + + + Enter mnemonic + + + + + + Enter Index (default: 0) + + + + Extract + + +