Skip to content

Commit

Permalink
Merge pull request #1711 from MyCryptoHQ/develop
Browse files Browse the repository at this point in the history
Tag Release Candidate 2
  • Loading branch information
dternyak authored May 2, 2018
2 parents cf82c4c + 9e844b7 commit effd46e
Show file tree
Hide file tree
Showing 124 changed files with 1,400 additions and 576 deletions.
2 changes: 2 additions & 0 deletions common/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ErrorScreen from 'components/ErrorScreen';
import PageNotFound from 'components/PageNotFound';
import LogOutPrompt from 'components/LogOutPrompt';
import QrSignerModal from 'containers/QrSignerModal';
import NewAppReleaseModal from 'components/NewAppReleaseModal';
import { TitleBar } from 'components/ui';
import { Store } from 'redux';
import { pollOfflineStatus, TPollOfflineStatus } from 'actions/config';
Expand Down Expand Up @@ -108,6 +109,7 @@ class RootClass extends Component<Props, State> {
<LegacyRoutes />
<LogOutPrompt />
<QrSignerModal />
{process.env.BUILD_ELECTRON && <NewAppReleaseModal />}
</React.Fragment>
</Router>
</Provider>
Expand Down
28 changes: 28 additions & 0 deletions common/actions/message/actionCreators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';
import { ISignedMessage } from 'libs/signing';

export type TSignMessageRequested = typeof signMessageRequested;
export function signMessageRequested(payload: string): interfaces.SignMessageRequestedAction {
return {
type: TypeKeys.SIGN_MESSAGE_REQUESTED,
payload
};
}

export type TSignLocalMessageSucceeded = typeof signLocalMessageSucceeded;
export function signLocalMessageSucceeded(
payload: ISignedMessage
): interfaces.SignLocalMessageSucceededAction {
return {
type: TypeKeys.SIGN_LOCAL_MESSAGE_SUCCEEDED,
payload
};
}

export type TSignMessageFailed = typeof signMessageFailed;
export function signMessageFailed(): interfaces.SignMessageFailedAction {
return {
type: TypeKeys.SIGN_MESSAGE_FAILED
};
}
22 changes: 22 additions & 0 deletions common/actions/message/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { TypeKeys } from './constants';
import { ISignedMessage } from 'libs/signing';

export interface SignMessageRequestedAction {
type: TypeKeys.SIGN_MESSAGE_REQUESTED;
payload: string;
}

export interface SignLocalMessageSucceededAction {
type: TypeKeys.SIGN_LOCAL_MESSAGE_SUCCEEDED;
payload: ISignedMessage;
}

export interface SignMessageFailedAction {
type: TypeKeys.SIGN_MESSAGE_FAILED;
}

/*** Union Type ***/
export type MessageAction =
| SignMessageRequestedAction
| SignLocalMessageSucceededAction
| SignMessageFailedAction;
5 changes: 5 additions & 0 deletions common/actions/message/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum TypeKeys {
SIGN_MESSAGE_REQUESTED = 'SIGN_MESSAGE_REQUESTED',
SIGN_LOCAL_MESSAGE_SUCCEEDED = 'SIGN_LOCAL_MESSAGE_SUCCEEDED',
SIGN_MESSAGE_FAILED = 'SIGN_MESSAGE_FAILED'
}
3 changes: 3 additions & 0 deletions common/actions/message/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './actionCreators';
export * from './constants';
export * from './actionTypes';
27 changes: 23 additions & 4 deletions common/actions/paritySigner/actionCreators.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
import * as types from './actionTypes';
import { TypeKeys } from './constants';

export type TRequestSignature = typeof requestSignature;
export function requestSignature(from: string, rlp: string): types.RequestSignatureAction {
export type TRequestTransactionSignature = typeof requestTransactionSignature;
export function requestTransactionSignature(
from: string,
data: string
): types.RequestTransactionSignatureAction {
return {
type: TypeKeys.PARITY_SIGNER_REQUEST_SIGNATURE,
type: TypeKeys.PARITY_SIGNER_REQUEST_TX_SIGNATURE,
payload: {
isMessage: false,
from,
rlp
data
}
};
}

export type TRequestMessageSignature = typeof requestMessageSignature;
export function requestMessageSignature(
from: string,
data: string
): types.RequestMessageSignatureAction {
return {
type: TypeKeys.PARITY_SIGNER_REQUEST_MSG_SIGNATURE,
payload: {
isMessage: true,
from,
data
}
};
}
Expand Down
21 changes: 17 additions & 4 deletions common/actions/paritySigner/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { TypeKeys } from './constants';

export interface RequestSignatureAction {
type: TypeKeys.PARITY_SIGNER_REQUEST_SIGNATURE;
export interface RequestTransactionSignatureAction {
type: TypeKeys.PARITY_SIGNER_REQUEST_TX_SIGNATURE;
payload: {
rlp: string;
isMessage: false;
data: string;
from: string;
};
}

export interface RequestMessageSignatureAction {
type: TypeKeys.PARITY_SIGNER_REQUEST_MSG_SIGNATURE;
payload: {
isMessage: true;
data: string;
from: string;
};
}
Expand All @@ -14,4 +24,7 @@ export interface FinalizeSignatureAction {
}

/*** Union Type ***/
export type ParitySignerAction = RequestSignatureAction | FinalizeSignatureAction;
export type ParitySignerAction =
| RequestTransactionSignatureAction
| RequestMessageSignatureAction
| FinalizeSignatureAction;
3 changes: 2 additions & 1 deletion common/actions/paritySigner/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum TypeKeys {
PARITY_SIGNER_REQUEST_SIGNATURE = 'PARITY_SIGNER_REQUEST_SIGNATURE',
PARITY_SIGNER_REQUEST_TX_SIGNATURE = 'PARITY_SIGNER_REQUEST_TX_SIGNATURE',
PARITY_SIGNER_REQUEST_MSG_SIGNATURE = 'PARITY_SIGNER_REQUEST_MSG_SIGNATURE',
PARITY_SIGNER_FINALIZE_SIGNATURE = 'PARITY_SIGNER_FINALIZE_SIGNATURE'
}
22 changes: 16 additions & 6 deletions common/actions/transaction/actionCreators/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
InputGasPriceIntentAction,
InputDataAction,
InputNonceAction,
ResetAction,
ResetTransactionRequestedAction,
ResetTransactionSuccessfulAction,
SetGasPriceFieldAction
} from '../actionTypes';
import { TypeKeys } from 'actions/transaction/constants';
Expand Down Expand Up @@ -80,9 +81,16 @@ const setGasPriceField = (payload: SetGasPriceFieldAction['payload']): SetGasPri
payload
});

type TReset = typeof reset;
const reset = (payload: ResetAction['payload'] = { include: {}, exclude: {} }): ResetAction => ({
type: TypeKeys.RESET,
type TResetTransactionRequested = typeof resetTransactionRequested;
const resetTransactionRequested = (): ResetTransactionRequestedAction => ({
type: TypeKeys.RESET_REQUESTED
});

type TResetTransactionSuccessful = typeof resetTransactionSuccessful;
const resetTransactionSuccessful = (
payload: ResetTransactionSuccessfulAction['payload']
): ResetTransactionSuccessfulAction => ({
type: TypeKeys.RESET_SUCCESSFUL,
payload
});

Expand All @@ -98,7 +106,8 @@ export {
TSetNonceField,
TSetValueField,
TSetGasPriceField,
TReset,
TResetTransactionRequested,
TResetTransactionSuccessful,
inputGasLimit,
inputGasPrice,
inputGasPriceIntent,
Expand All @@ -110,5 +119,6 @@ export {
setNonceField,
setValueField,
setGasPriceField,
reset
resetTransactionRequested,
resetTransactionSuccessful
};
12 changes: 11 additions & 1 deletion common/actions/transaction/actionCreators/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import {
TypeKeys,
SetUnitMetaAction,
SetTokenValueMetaAction,
SetTokenToMetaAction
SetTokenToMetaAction,
SetAsContractInteractionAction,
SetAsViewAndSendAction
} from 'actions/transaction';

export type TSetTokenTo = typeof setTokenTo;
Expand All @@ -24,3 +26,11 @@ export const setUnitMeta = (payload: SetUnitMetaAction['payload']): SetUnitMetaA
type: TypeKeys.UNIT_META_SET,
payload
});

export type TSetAsContractInteraction = typeof setAsContractInteraction;
export const setAsContractInteraction = (): SetAsContractInteractionAction => ({
type: TypeKeys.IS_CONTRACT_INTERACTION
});

export type TSetAsViewAndSend = typeof setAsViewAndSend;
export const setAsViewAndSend = (): SetAsViewAndSendAction => ({ type: TypeKeys.IS_VIEW_AND_SEND });
27 changes: 9 additions & 18 deletions common/actions/transaction/actionTypes/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { SignAction } from './sign';
import { SwapAction } from './swap';
import { CurrentAction } from './current';
import { SendEverythingAction } from './sendEverything';
import { State as FieldState } from 'reducers/transaction/fields';
import { State as MetaState } from 'reducers/transaction/meta';
import { State as SignState } from 'reducers/transaction/sign';

export * from './broadcast';
export * from './fields';
Expand All @@ -20,20 +17,13 @@ export * from './swap';
export * from './current';
export * from './sendEverything';

export interface ResetAction {
type: TypeKeys.RESET;
payload: {
include: {
fields?: (keyof FieldState)[];
meta?: (keyof MetaState)[];
sign?: (keyof SignState)[];
};
exclude: {
fields?: (keyof FieldState)[];
meta?: (keyof MetaState)[];
sign?: (keyof SignState)[];
};
};
export interface ResetTransactionRequestedAction {
type: TypeKeys.RESET_REQUESTED;
}

export interface ResetTransactionSuccessfulAction {
type: TypeKeys.RESET_SUCCESSFUL;
payload: { isContractInteraction: boolean };
}

export type TransactionAction =
Expand All @@ -44,6 +34,7 @@ export type TransactionAction =
| NetworkAction
| SignAction
| SwapAction
| ResetAction
| ResetTransactionRequestedAction
| ResetTransactionSuccessfulAction
| CurrentAction
| SendEverythingAction;
24 changes: 22 additions & 2 deletions common/actions/transaction/actionTypes/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ interface SetTokenValueMetaAction {
};
}

type MetaAction = SetUnitMetaAction | SetTokenValueMetaAction | SetTokenToMetaAction;
interface SetAsContractInteractionAction {
type: TypeKeys.IS_CONTRACT_INTERACTION;
}

interface SetAsViewAndSendAction {
type: TypeKeys.IS_VIEW_AND_SEND;
}

type TransactionMetaAction = SetUnitMetaAction | SetTokenValueMetaAction | SetTokenToMetaAction;
type TransactionTypeMetaAction = SetAsContractInteractionAction | SetAsViewAndSendAction;

type MetaAction = TransactionMetaAction | TransactionTypeMetaAction;

export { MetaAction, SetUnitMetaAction, SetTokenToMetaAction, SetTokenValueMetaAction };
export {
TransactionMetaAction,
TransactionTypeMetaAction,
MetaAction,
SetUnitMetaAction,
SetTokenToMetaAction,
SetTokenValueMetaAction,
SetAsContractInteractionAction,
SetAsViewAndSendAction
};
6 changes: 5 additions & 1 deletion common/actions/transaction/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@ export enum TypeKeys {
SEND_EVERYTHING_SUCCEEDED = 'SEND_EVERYTHING_SUCCEEDED',
SEND_EVERYTHING_FAILED = 'SEND_EVERYTHING_FAILED',

RESET = 'RESET'
IS_CONTRACT_INTERACTION = 'IS_CONTRACT_INTERACTION',
IS_VIEW_AND_SEND = 'IS_VIEW_AND_SEND',

RESET_REQUESTED = 'TRANSACTION_RESET_REQUESTED',
RESET_SUCCESSFUL = 'TRANSACTION_RESET_SUCCESSFUL'
}
4 changes: 2 additions & 2 deletions common/api/rates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export const rateSymbols: IRateSymbols = {

// TODO - internationalize
const ERROR_MESSAGE = 'Could not fetch rate data.';
const CCApi = 'https://min-api.cryptocompare.com';
const CCApi = 'https://proxy.mycryptoapi.com/cc';

const CCRates = (symbols: string[]) => {
const tsyms = rateSymbols.symbols.all.concat(symbols as any).join(',');
return `${CCApi}/data/price?fsym=ETH&tsyms=${tsyms}`;
return `${CCApi}/price?fsym=ETH&tsyms=${tsyms}`;
};

export interface CCResponse {
Expand Down
Binary file added common/assets/images/unlock-guide/open-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added common/assets/images/unlock-guide/tab-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
53 changes: 53 additions & 0 deletions common/components/AppAlphaNotice/AlphaNotice.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@import 'common/sass/variables';
@import 'common/sass/mixins';

.AppAlpha {
@include cover-message;
background: $brand-info;
left: $electron-sidebar-width - 1;

&-content {
h2 {
text-align: center;
}

p {
text-align: justify;
}

&-btn {
display: block;
width: 100%;
max-width: 280px;
margin: 40px auto 0;
border: none;
padding: 0;
transition: $transition;
height: 60px;
line-height: 60px;
font-size: 22px;
background: rgba(#fff, 0.96);
color: $gray-dark;
border-radius: 4px;

&:hover {
background: #fff;
color: $gray-darker;
}
}
}

// Fade out
&.is-fading {
pointer-events: none;
opacity: 0;
background: #fff;
transition: all 500ms ease 400ms;

.AppAlpha-content {
opacity: 0;
transform: translateY(15px);
transition: all 500ms ease;
}
}
}
Loading

0 comments on commit effd46e

Please sign in to comment.