Skip to content

Commit

Permalink
Merge pull request #204 from MyEtherWallet/develop
Browse files Browse the repository at this point in the history
Alpha 0.0.2
  • Loading branch information
dternyak authored Sep 18, 2017
2 parents 8aa0a08 + 141cb41 commit 22ab3af
Show file tree
Hide file tree
Showing 207 changed files with 5,145 additions and 10,026 deletions.
47 changes: 26 additions & 21 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{
"plugins": [
[
"transform-runtime", {
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
}
],
["module-resolver", {
"root": ["./common"],
"alias": {
"underscore": "lodash"
},
"cwd": "babelrc"
}],
"react-hot-loader/babel"],
"presets": ["es2015", "react", "stage-0", "flow"],
"env": {
"production": {
"presets": ["react-optimize"]
"plugins": [
[
"transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
}
],
[
"module-resolver",
{
"root": ["./common"],
"alias": {
"underscore": "lodash"
},
"cwd": "babelrc"
}
],
"react-hot-loader/babel"
],
"presets": ["es2015", "react", "stage-0", "flow"],
"env": {
"production": {
"presets": ["react-optimize"]
}
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ jspm_packages

# Optional REPL history
.node_repl_history

# VScode workspace settings
.vscode/
static/dll.vendor.js
dll
13 changes: 8 additions & 5 deletions common/actions/deterministicWallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,32 @@ export type DeterministicWalletData = {
export type GetDeterministicWalletsAction = {
type: 'DW_GET_WALLETS',
payload: {
seed: ?string,
dPath: string,
publicKey: string,
chainCode: string,
publicKey: ?string,
chainCode: ?string,
limit: number,
offset: number
}
};

export type GetDeterministicWalletsArgs = {
seed: ?string,
dPath: string,
publicKey: string,
chainCode: string,
publicKey: ?string,
chainCode: ?string,
limit?: number,
offset?: number
};

export function getDeterministicWallets(
args: GetDeterministicWalletsArgs
): GetDeterministicWalletsAction {
const { dPath, publicKey, chainCode, limit, offset } = args;
const { seed, dPath, publicKey, chainCode, limit, offset } = args;
return {
type: 'DW_GET_WALLETS',
payload: {
seed,
dPath,
publicKey,
chainCode,
Expand Down
2 changes: 1 addition & 1 deletion common/actions/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type ShowNotificationAction = {
export function showNotification(
level: NOTIFICATION_LEVEL = 'info',
msg: Element<*> | string,
duration?: number
duration?: number | INFINITY
): ShowNotificationAction {
return {
type: 'SHOW_NOTIFICATION',
Expand Down
22 changes: 17 additions & 5 deletions common/actions/rates.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
// @flow

export type FiatRequestedRatesAction = {
type: 'RATES_FIAT_REQUESTED'
};

export function fiatRequestedRates() {
return {
type: 'RATES_FIAT_REQUESTED'
};
}

/*** Set rates ***/
export type SetRatesAction = {
type: 'RATES_SET',
export type FiatSucceededRatesAction = {
type: 'RATES_FIAT_SUCCEEDED',
payload: { [string]: number }
};

export function setRates(payload: { [string]: number }): SetRatesAction {
export function fiatSucceededRates(payload: {
[string]: number
}): FiatSucceededRatesAction {
return {
type: 'RATES_SET',
type: 'RATES_FIAT_SUCCEEDED',
payload
};
}

/*** Union Type ***/
export type RatesAction = SetRatesAction;
export type RatesAction = FiatSucceededRatesAction | FiatRequestedRatesAction;
33 changes: 28 additions & 5 deletions common/actions/wallet.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
import BaseWallet from 'libs/wallet/base';
import type { IWallet } from 'libs/wallet/IWallet';
import Big from 'bignumber.js';
import { Wei } from 'libs/units';

/*** Unlock Private Key ***/
export type PrivateKeyUnlockParams = {
Expand Down Expand Up @@ -42,13 +43,35 @@ export function unlockKeystore(
};
}

/*** Unlock Mnemonic ***/
export type MnemonicUnlockParams = {
phrase: string,
pass: string,
path: string,
address: string
};

export type UnlockMnemonicAction = {
type: 'WALLET_UNLOCK_MNEMONIC',
payload: MnemonicUnlockParams
};

export function unlockMnemonic(
value: MnemonicUnlockParams
): UnlockMnemonicAction {
return {
type: 'WALLET_UNLOCK_MNEMONIC',
payload: value
};
}

/*** Set Wallet ***/
export type SetWalletAction = {
type: 'WALLET_SET',
payload: BaseWallet
payload: IWallet
};

export function setWallet(value: BaseWallet): SetWalletAction {
export function setWallet(value: IWallet): SetWalletAction {
return {
type: 'WALLET_SET',
payload: value
Expand All @@ -58,10 +81,10 @@ export function setWallet(value: BaseWallet): SetWalletAction {
/*** Set Balance ***/
export type SetBalanceAction = {
type: 'WALLET_SET_BALANCE',
payload: Big
payload: Wei
};

export function setBalance(value: Big): SetBalanceAction {
export function setBalance(value: Wei): SetBalanceAction {
return {
type: 'WALLET_SET_BALANCE',
payload: value
Expand Down
2 changes: 1 addition & 1 deletion common/api/bity.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function getOrderStatus(orderid: string) {
}

function _getAllRates() {
return fetch(`${bityConfig.bityAPI}/v1/rate2/`)
return fetch(`${bityConfig.bityURL}/v1/rate2/`)
.then(checkHttpStatus)
.then(parseJSON);
}
Expand Down
1 change: 1 addition & 0 deletions common/assets/images/icon-help-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions common/assets/images/logo-coinbase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions common/assets/images/logo-ledger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions common/assets/images/logo-trezor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 22ab3af

Please sign in to comment.