Skip to content

Commit

Permalink
Merge pull request #52 from KayBeSee/next
Browse files Browse the repository at this point in the history
v1.1 Test Release
  • Loading branch information
KayBeSee authored Jan 12, 2021
2 parents b89ac68 + cc40436 commit 7ad9686
Show file tree
Hide file tree
Showing 192 changed files with 105,682 additions and 10,165 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ LilyWallet-darwin-x64
.DS_Store
dist/
LilyWallet-*
.env
compiled-ts/
Binary file modified HWIs/HWI_LINUX
Binary file not shown.
Binary file modified HWIs/HWI_MAC
Binary file not shown.
Binary file modified HWIs/hwi.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// babel.config.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
17,889 changes: 17,889 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 44 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"scripts": {
"electron": "electron .",
"start": "PORT=3001 react-scripts start",
"electron-testnet": "TESTNET=true electron .",
"build": "react-scripts build",
"test": "react-scripts test",
"test": "react-scripts test --testPathIgnorePatterns=src/__tests__/mock",
"eject": "react-scripts eject",
"pack": "electron-builder --dir",
"dist": "electron-builder -mwl",
Expand All @@ -27,12 +28,17 @@
"target": [
"dmg"
],
"entitlements": "./build/entitlements.mac.inherit.plist",
"extendInfo": {
"NSCameraUsageDescription": "Allow your camera to scan QR codes during account setup and transaction signing."
},
"files": [
"./build/**/*",
"./src/main.js",
"./src/preload.js",
"./src/server/**/*",
"./src/utils/**/*",
"./src/types/*",
"./HWIs/HWI_MAC"
]
},
Expand All @@ -52,6 +58,7 @@
"./src/preload.js",
"./src/server/**/*",
"./src/utils/**/*",
"./src/types/*",
"./HWIs/HWI_LINUX"
]
},
Expand All @@ -62,35 +69,41 @@
"./src/preload.js",
"./src/server/**/*",
"./src/utils/**/*",
"./src/types/*",
"./HWIs/hwi.exe"
]
}
},
"dependencies": {
"axios": "^0.19.2",
"@cvbb/qr-protocol": "^0.1.6",
"@cvbb/sdk": "^0.1.8",
"axios": "^0.21.1",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"bignumber.js": "^9.0.0",
"bip39": "^3.0.2",
"bitcoin-core": "^3.0.0",
"bitcoinjs-lib": "^5.1.10",
"bitcoinjs-message": "^2.1.4",
"bs58check": "^2.1.2",
"coinselect": "^3.1.12",
"cors": "^2.8.5",
"crypto-js": "^4.0.0",
"electron-dl": "^3.0.0",
"moment": "^2.24.0",
"dotenv": "^8.2.0",
"moment": "^2.29.1",
"polished": "^3.5.1",
"react": "^16.13.1",
"react-copy-to-clipboard": "^5.0.2",
"react-dom": "^16.13.1",
"react-modal": "^3.11.2",
"react-qr-svg": "^2.2.2",
"react-router-dom": "^5.1.2",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-spring": "^8.0.27",
"react-webcam-barcode-scanner": "0.0.2-rc2",
"recharts": "^1.8.5",
"styled-components": "^5.1.0",
"styled-icons": "^10.2.1",
"styled-icons": "^10.19.0",
"unchained-bitcoin": "0.0.9",
"uuid": "^8.0.0"
},
Expand All @@ -107,11 +120,34 @@
]
},
"devDependencies": {
"@types/crypto-js": "^4.0.1",
"@types/jest": "^26.0.15",
"@types/react": "^16.9.53",
"@types/react-copy-to-clipboard": "^4.3.0",
"@types/react-dom": "^16.9.8",
"@types/react-modal": "^3.10.6",
"@types/react-router-dom": "^5.1.6",
"@types/recharts": "^1.8.16",
"@types/rewire": "^2.5.28",
"@types/styled-components": "^5.1.4",
"@types/uuid": "^8.3.0",
"electron": "^9.0.0",
"electron-builder": "^22.7.0",
"electron-installer-dmg": "^3.0.0",
"electron-mock-ipc": "^0.3.8",
"electron-packager": "^14.2.1",
"electron-winstaller": "^4.0.0",
"react-app-rewired": "^2.1.6"
"jest-when": "^3.0.0",
"mocha": "^8.1.3",
"react-app-rewired": "^2.1.6",
"rewire": "^5.0.0",
"source-map-loader": "^1.1.1",
"ts-loader": "^8.0.7",
"typescript": "^4.0.3"
},
"jest": {
"moduleNameMapper": {
"^electron$": "<rootDir>/src/__tests__/mock/electron-mock.ts"
}
}
}
}
Binary file modified public/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions public/entitlements.mac.inherit.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
</dict>
</plist>
44 changes: 44 additions & 0 deletions src/AccountMapContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, { createContext, useReducer, useCallback, useState } from 'react';

import {
accountMapReducer,
ACCOUNTMAP_UPDATE,
ACCOUNTMAP_SET
} from './reducers/accountMap';

import { AccountMap, LilyAccount } from './types'

export const AccountMapContext = createContext({
setAccountMap: (accountMap: AccountMap) => { },
updateAccountMap: (account: LilyAccount) => { },
setCurrentAccountId: (id: string) => { },
accountMap: {} as AccountMap,
currentAccount: {} as LilyAccount
});

export const AccountMapProvider = ({ children }: { children: React.ReactChild }) => {
const [accountMap, dispatch] = useReducer(accountMapReducer, {});
const [currentAccountId, setCurrentAccountId] = useState('satoshi');

const currentAccount = accountMap[currentAccountId!] || { name: 'Loading...', loading: true, transactions: [], unusedAddresses: [], currentBalance: 0, config: {} };

const updateAccountMap = useCallback((account: LilyAccount) => {
dispatch({
type: ACCOUNTMAP_UPDATE,
payload: {
account
}
})
}, [dispatch])

const setAccountMap = useCallback((accountMap: AccountMap) => {
dispatch({
type: ACCOUNTMAP_SET,
payload: accountMap
})
}, [dispatch])

const value = { accountMap, updateAccountMap, setAccountMap, currentAccount, setCurrentAccountId }

return <AccountMapContext.Provider value={value}>{children}</AccountMapContext.Provider>
}
Loading

0 comments on commit 7ad9686

Please sign in to comment.