Skip to content

Commit

Permalink
Merge pull request #368 from z3us-dapps/develop
Browse files Browse the repository at this point in the history
v1.0.46+ext
  • Loading branch information
heathsnee authored Sep 13, 2023
2 parents 8e908cd + c514a3d commit 8b6eeb7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ Before adding to firefox some changes to manifest file must be made:
},
```

3. Add `extension id` to `manifest`
```diff
+ "browser_specific_settings": {
+ "gecko": {
+ "id": "[email protected]",
+ "strict_min_version": "42.0"
+ }
+ },
```

- Create archive by compresing all the files `inside` the directory `apps/extension/dist`.
- In the Firefox browser navigate to `about:debugging#/runtime/this-firefox`.
- Click the button `Load temporary Add-on...`, then select an archive file you prepared.
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "z3us-extension",
"version": "1.0.46",
"version": "1.0.47",
"scripts": {
"dev": "yarn start",
"start": "vite --mode development",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import HDNode from 'hdkey'
import { QRCodeSVG } from 'qrcode.react'
import React, { useRef } from 'react'
import { useImmer } from 'use-immer'
Expand Down Expand Up @@ -76,6 +77,7 @@ export const exportAsCode = (accounts: string[], payloadSize: number, mnemonicLe
interface ImmerT {
words: string[]
exports: string[]
privateExtendedKey: string
password: string
errorMessage: string
isQrModalOpen: boolean
Expand All @@ -96,6 +98,7 @@ const AccountExport: React.FC = () => {
const [state, setState] = useImmer<ImmerT>({
words: [],
exports: [],
privateExtendedKey: '',
password: '',
errorMessage: '',
isQrModalOpen: false,
Expand All @@ -107,14 +110,15 @@ const AccountExport: React.FC = () => {
draft.isExportingAccounts = true
})
try {
const { mnemonic } = await getWallet(state.password)
const { mnemonic, hdMasterNode } = await getWallet(state.password)
const summaries = []
Object.keys(publicAddresses).forEach(idx =>
summaries.push(accountSummary(publicAddresses[idx], +idx, keystore.type === KeystoreType.LOCAL)),
)
const exports = exportAsCode(summaries, 1800, mnemonic?.words.length || 24)
setState(draft => {
draft.words = mnemonic?.words || []
draft.privateExtendedKey = hdMasterNode ? HDNode.fromJSON(hdMasterNode).privateExtendedKey.toString() : ''
draft.exports = exports
draft.isQrModalOpen = true
})
Expand Down Expand Up @@ -241,6 +245,22 @@ const AccountExport: React.FC = () => {
</Flex>
</Box>
)}
{state.privateExtendedKey && (
<Box
css={{
background: '$bgPanel',
p: '$4',
pb: '30px',
br: '$2',
border: '1px solid $borderPanel',
position: 'relative',
}}
>
<Flex css={{ overflow: 'hidden', flexWrap: 'wrap', overflowWrap: 'anywhere' }}>
<Text size="4">{state.privateExtendedKey}</Text>
</Flex>
</Box>
)}
</Flex>
</Box>
<Box css={{ mt: '$2' }}>
Expand Down

0 comments on commit 8b6eeb7

Please sign in to comment.