Skip to content

Commit

Permalink
Release (#2545)
Browse files Browse the repository at this point in the history
* refactor: remove and refactor unused old selfkey-id components

* feat: add profille components to storybook

* refactor: new transaction fee UI

* feat: add moonpay option to buy key (#2524)

* 2500 moonpay terms (#2526)

* feat: add moonpay terms of service popup

* 2504 phone verification (#2527)

* feat: add moonpay terms of service popup

* feat: phone-verification screen

* feat: add moonpay-service

* feat: implement customer endpoints of moonpay api

* feat: implement create token

* feat: implement cards api

* feat: implement bank accounts and transactions

* feat: add test payment methods

* feat: add test payment methods

* feat: decouple moonpay api from identity

* feat: add support for setting nonce in transactions

* feat: refactored send transaction window

* 2506 cc form (#2528)

* feat: add moonpay terms of service popup

* feat: phone-verification screen

* feat: add icon to phone verification

* feat: ui for add payment method

* feat: updated allowance transaction

* feat: hd-auth flow

* feat: enable contract allowance on prod

* feat: auth flow complete

* feat: update settings on auth

* feat: service check

* feat: service flow complete

* fix: supported countries link

* feat: save wallet screen (#2539)

* feat: check keyfi airtable status (#2541)

* feat: changed keyfi pause message, improve handling of keyfi product

* fix: null selector error (#2543)

* Fix transaction negative amount (#2544)

* feat(version): bump to 1.9.1

Co-authored-by: Kovalov Maxim <max.kovalov@gmail.com>
Co-authored-by: Andre Goncalves <andre@andregoncalves.com>
  • Loading branch information
andregoncalves and sk91 authored Jan 3, 2021
1 parent b040eab commit bbd29c5
Show file tree
Hide file tree
Showing 126 changed files with 8,538 additions and 3,293 deletions.
3 changes: 2 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ LOG_LEVEL=debug
# FEATURE_CORPORATE_MARKETPLACE=0
# FEATURE_WALLET_EXPORT=0
# FEATURE_TRANSACTIONS_LIST_FILTER=0
# FEATURE_TOKEN_SWAP=0
# FEATURE_SWAP_TOKENS=0
# FEATURE_EXCHANGES_MARKETPLACE=0
# FEATURE_REWARD_TOKEN=1
# FEATURE_KEYFI=1
# FEATURE_HD_WALLET=0
# FEATURE_DEEP_LINKS=0
# FEATURE_MOONPAY=0
###############

## Choose Etherium network
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"es6": true,
"node": true,
"mocha": true,
"jest": true
"jest": true,
"jasmine": true
},
"rules": {
"prettier/prettier": [
Expand Down
2 changes: 1 addition & 1 deletion .storybook/store-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
"usdFee": 0,
"gasPrice": 0,
"gasLimit": 0,
"nouce": 0,
"nonce": 0,
"signedHex": "",
"transactionHash": "",
"addressError": false,
Expand Down
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "selfkey-identity-wallet",
"productName": "SelfKey Identity Wallet",
"version": "1.9.0",
"version": "1.9.1",
"description": "The Official SelfKey Identity Wallet for Desktop",
"browser": [
"chrome"
Expand Down Expand Up @@ -73,14 +73,15 @@
"@ledgerhq/hw-app-eth": "5.28.0",
"@ledgerhq/hw-transport-node-hid": "5.28.0",
"@ledgerhq/web3-subprovider": "5.28.0",
"@material-ui/core": "4.9.9",
"@material-ui/core": "4.9.10",
"@material-ui/icons": "4.9.1",
"@material-ui/lab": "4.0.0-alpha.48",
"@material-ui/styles": "4.9.6",
"@reduxjs/toolkit": "1.5.0",
"@sentry/electron": "0.17.1",
"@trodi/electron-splashscreen": "0.3.4",
"@walletconnect/client": "^1.3.1",
"@walletconnect/utils": "^1.3.1",
"@walletconnect/client": "1.3.1",
"@walletconnect/utils": "1.3.1",
"ajv": "6.10.0",
"async": "2.6.2",
"awilix": "4.2.1",
Expand All @@ -101,6 +102,7 @@
"fs-extra": "7.0.1",
"hdkey": "2.0.1",
"human-standard-token-abi": "2.0.0",
"i18n-iso-countries": "6.3.0",
"is-online": "8.2.0",
"jsdom": "15.0.0",
"json-schema-ref-parser": "6.1.0",
Expand All @@ -112,10 +114,12 @@
"md5": "2.2.1",
"mime-types": "2.1.23",
"moment": "2.24.0",
"nanoid": "3.1.20",
"node-fetch": "2.3.0",
"node-machine-id": "1.1.10",
"normalizr": "3.6.0",
"objection": "1.6.8",
"parameter-validator": "1.0.5",
"prop-types": "15.7.2",
"qrcode-generator": "1.4.3",
"qrcode.react": "1.0.0",
Expand All @@ -135,7 +139,7 @@
"reselect": "4.0.0",
"sanitize-html": "1.20.0",
"scrypt": "6.0.3",
"selfkey-ui": "https://github.com/SelfKeyFoundation/selfkey-ui.git#d1cd8f84e44caba17e64dca083ff81d3c62c3040",
"selfkey-ui": "https://github.com/SelfKeyFoundation/selfkey-ui.git#945f6987ca05a36ca2b32f0e02b9351f9105329d",
"selfkey.js": "1.0.24",
"serialize-error": "3.0.0",
"snyk": "1.235.0",
Expand All @@ -149,7 +153,7 @@
"trezor-wallet-provider": "https://github.com/SelfKeyFoundation/trezor-wallet-provider.git#2a944494e6cd0ba507d5a4946d3d20d984548e60",
"trezor.js": "9.0.0",
"url-join": "4.0.0",
"walletconnect": "^1.3.1",
"walletconnect": "1.3.1",
"web3": "1.2.11",
"web3-provider-engine": "15.0.4",
"ws": "7.0.0",
Expand Down Expand Up @@ -260,8 +264,9 @@
"react": "16.13.1",
"react-dom": "16.13.1",
"react-jsonschema-form-material-theme": "https://github.com/SelfKeyFoundation/react-jsonschema-form-material-theme.git#e8356d2037b527f7b0a8433f20c476b6e501d70e",
"selfkey-ui": "https://github.com/SelfKeyFoundation/selfkey-ui.git#d1cd8f84e44caba17e64dca083ff81d3c62c3040",
"@material-ui/styles": "4.9.6"
"selfkey-ui": "https://github.com/SelfKeyFoundation/selfkey-ui.git#945f6987ca05a36ca2b32f0e02b9351f9105329d",
"@material-ui/styles": "4.9.6",
"@material-ui/core": "4.9.10"
},
"migrations": {
"version": "20180508093508"
Expand Down
46 changes: 37 additions & 9 deletions src/common/app/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getGlobalContext } from 'common/context';
import _ from 'lodash';
import crypto from 'crypto';
import { createAliasedAction } from 'electron-redux';
import { walletOperations, walletSelectors } from '../wallet';
Expand All @@ -16,14 +17,16 @@ const log = new Logger('app-redux');

const eventEmitter = new EventEmitter();

export const appSelectors = {};

const transformErrorMessage = msg => {
if (msg === 'Key derivation failed - possibly wrong password') {
return 'Wrong password. Please try again';
}
return msg;
};

export const initialState = {
const initialState = {
walletsLoading: false,
wallets: [],
seed: null,
Expand All @@ -34,6 +37,7 @@ export const initialState = {
isOnline: true,
goBackPath: '',
goNextPath: '',
selectedPrivateKey: '',
autoUpdate: {
info: {},
progress: {},
Expand All @@ -42,7 +46,7 @@ export const initialState = {
keyStoreValue: null
};

export const appTypes = {
const appTypes = {
APP_SET_WALLETS: 'app/set/WALLETS',
APP_SET_SEED: 'app/set/SEED',
APP_SET_WALLETS_LOADING: 'app/set/WALLETS_LOADING',
Expand Down Expand Up @@ -77,7 +81,8 @@ export const appTypes = {
LOAD_KEYSTORE_VALUE: 'app/keystore/LOAD',
APP_SEED_UNLOCK_START: 'app/seed/unlock',
APP_SEED_GENERATE: 'app/seed/generate',
APP_RESET: 'app/reset'
APP_RESET: 'app/reset',
APP_SET_SELECTED_PK: 'app/set/selected/private-key'
};

const appActions = {
Expand Down Expand Up @@ -140,6 +145,10 @@ const appActions = {
resetAppAction: payload => ({
type: appTypes.APP_RESET,
payload
}),
setSelectedPrivateKeyAction: key => ({
type: appTypes.APP_SET_SELECTED_PK,
payload: key
})
};

Expand Down Expand Up @@ -235,10 +244,21 @@ const unlockWalletWithNewFile = (filePath, password) => async dispatch => {
}
};

const unlockWalletWithPrivateKey = (privateKey, password) => async dispatch => {
const unlockWalletWithPrivateKey = (privateKey, password, checkPassword = true) => async (
dispatch,
getState
) => {
const walletService = getGlobalContext().walletService;
const wallet = await walletService.unlockWalletWithPrivateKey(privateKey, password);
const wallets = selectApp(getState()).wallets;
try {
const wallet = await walletService.unlockWalletWithPrivateKey(privateKey, password);
if (checkPassword && !password && !wallets.find(w => w.address === wallet.address)) {
await dispatch(appActions.setSelectedPrivateKeyAction(privateKey));
await dispatch(push('/saveWallet'));
return;
}

await dispatch(appActions.setSelectedPrivateKeyAction(''));
await dispatch(appOperations.unlockWalletOperation(wallet, 'privateKey'));
await dispatch(push('/main/dashboard'));
} catch (error) {
Expand Down Expand Up @@ -312,6 +332,7 @@ const loadHDWalletsOperation = (page = 0) => async (dispatch, getState) => {
);
await dispatch(appActions.setHardwareWalletsAction(wallets));
await dispatch(appActions.setWalletType('local'));

await dispatch(push('/selectAddress'));
} catch (error) {
const message = transformErrorMessage(error.message);
Expand Down Expand Up @@ -639,6 +660,10 @@ const appResetReducer = (state, action) => {
return { ...initialState };
};

const appSelectedPrivateKeyReducer = (state, action) => {
return { ...state, selectedPrivateKey: action.payload };
};

const appReducers = {
setWalletsReducer,
setWalletsLoadingReducer,
Expand All @@ -654,7 +679,8 @@ const appReducers = {
setAutoUpdateDownloadedReducer,
setKeystoreValueReducer,
setSeedReducer,
appResetReducer
appResetReducer,
appSelectedPrivateKeyReducer
};

const reducer = (state = initialState, action) => {
Expand Down Expand Up @@ -689,6 +715,8 @@ const reducer = (state = initialState, action) => {
return appReducers.setKeystoreValueReducer(state, action);
case appTypes.APP_RESET:
return appReducers.appResetReducer(state, action);
case appTypes.APP_SET_SELECTED_PK:
return appReducers.appSelectedPrivateKeyReducer(state, action);
}
return state;
};
Expand Down Expand Up @@ -741,7 +769,7 @@ const selectKeystoreValue = state => selectApp(state).keyStoreValue;

const selectSeed = state => selectApp(state).seed;

const appSelectors = {
_.merge(appSelectors, {
selectApp,
hasConnected,
hasAcceptedTracking,
Expand All @@ -754,8 +782,8 @@ const appSelectors = {
selectCanExportWallet,
selectKeystoreValue,
selectSeed
};
});

export { appSelectors, appReducers, appActions, appOperations };
export { appReducers, appActions, appOperations, appTypes, initialState };

export default reducer;
18 changes: 13 additions & 5 deletions src/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ const common = {
rewardToken: false,
keyfi: true,
hdWallet: true,
deepLinks: true
deepLinks: true,
moonpay: false
}
};

Expand Down Expand Up @@ -195,14 +196,17 @@ const dev = {
walletExport: true,
transactionsListFilter: true,
loansMarketplace: true,
swapTokens: true,
swapTokens: false,
contract: true,
exchangesMarketplace: false,
rewardToken: true,
keyfi: true,
hdWallet: true,
deepLinks: true
deepLinks: true,
moonpay: true
},
moonPayApiKey: 'pk_test_WLWaG0mO6kbetXr3tOODlXGsnzs3HR',
moonPayApiEndpoint: 'https://api.moonpay.com/v3',
testWalletAddress: '0x23d233933c86f93b74705cf0d236b39f474249f8',
testDidAddress: '0xee10a3335f48e10b444e299cf017d57879109c1e32cec3e31103ceca7718d0ec',
attributeTypeSource: ATTRIBUTE_TYPE_SOURCE_OVERRIDE || 'development'
Expand Down Expand Up @@ -238,13 +242,17 @@ const prod = {
transactionsListFilter: false,
loansMarketplace: true,
swapTokens: false,
contract: false,
contract: true,
exchangesMarketplace: false,
rewardToken: false,
keyfi: true,
hdWallet: true,
deepLinks: true
deepLinks: true,
moonpay: false
},
// TODO: change to prod before release
moonPayApiKey: 'pk_test_WLWaG0mO6kbetXr3tOODlXGsnzs3HR',
moonPayApiEndpoint: 'https://api.moonpay.com/v3',
attributeTypeSource: ATTRIBUTE_TYPE_SOURCE_OVERRIDE || 'production'
};

Expand Down
2 changes: 1 addition & 1 deletion src/common/contract/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const operations = {
}
}

if (!beforeUpdate.nonce && update) {
if (!beforeUpdate.nonce && update && !update.nonce) {
update.nonce = await getTransactionCount(wallet.address);
}

Expand Down
Loading

0 comments on commit bbd29c5

Please sign in to comment.