Merge branch 'develop' into finish-config-refactor

This commit is contained in:
Daniel Ternyak 2018-07-18 15:06:43 -07:00 committed by GitHub
commit 3854780c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 1699 additions and 10 deletions

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="217.19"
height="252"
viewBox="0 0 217.19 252"
version="1.1"
id="svg4200"
inkscape:version="0.91 r13725"
sodipodi:docname="safe-t.svg">
<metadata
id="metadata4215">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>trezor</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1381"
id="namedview4213"
showgrid="false"
inkscape:zoom="1.8294574"
inkscape:cx="153.14158"
inkscape:cy="62.034553"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4200" />
<!-- Generator: Sketch 48.1 (47250) - http://www.bohemiancoding.com/sketch -->
<title
id="title4202">trezor</title>
<desc
id="desc4204">Created with Sketch.</desc>
<defs
id="defs4206">
<clipPath
id="presentation_clip_path"
clipPathUnits="userSpaceOnUse">
<rect
x="0"
y="0"
width="21000"
height="29700"
id="rect7" />
</clipPath>
</defs>
<g
id="Page-1"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
transform="translate(0,-6)">
<g
id="trezor"
style="fill:#000000;fill-rule:nonzero">
<g
id="path7" />
</g>
</g>
<g
transform="matrix(0.03542311,0,0,0.03542311,-244.40864,-399.82064)"
class="SlideGroup"
id="g49">
<g
id="g51">
<g
id="id1"
class="Slide"
clip-path="url(#presentation_clip_path)">
<g
class="Page"
id="g54">
<g
class="com.sun.star.drawing.ClosedBezierShape"
id="g56">
<g
id="id3">
<rect
style="fill:none;stroke:none"
class="BoundingBox"
x="6900"
y="13921"
width="6114"
height="4480"
id="rect59" />
<path
style="fill:#000000;stroke:none"
inkscape:connector-curvature="0"
d="m 12880,15423 c 256,0 61,638 61,638 l 0,0 c -9,29 -20,53 -35,79 -4,8 -8,14 -13,22 -402,602 -2104,1772 -2705,2173 -7,5 -14,9 -22,14 -60,35 -120,51 -189,51 -70,0 -130,-16 -190,-51 -8,-5 -15,-9 -22,-14 -600,-401 -2303,-1571 -2705,-2173 -4,-8 -8,-14 -12,-21 -22,-37 -35,-71 -45,-112 -95,-400 -117,-879 -96,-1372 l 48,-735 c 0,0 1690,1634 5925,1501 z"
id="path61" />
</g>
</g>
<g
class="com.sun.star.drawing.ClosedBezierShape"
id="g63">
<g
id="id4">
<rect
style="fill:none;stroke:none"
class="BoundingBox"
x="7033"
y="11287"
width="5998"
height="3839"
id="rect66" />
<path
style="fill:#000000;stroke:none"
inkscape:connector-curvature="0"
d="m 13029,14494 c -77,-1049 -318,-2109 -437,-2592 l 0,0 c -9,-37 -21,-67 -40,-99 -35,-61 -79,-105 -140,-140 -47,-27 -91,-42 -145,-49 -587,-70 -1493,-327 -2283,-327 l -12,0 c -789,0 -1694,256 -2281,327 -55,7 -100,22 -147,49 -61,36 -105,80 -141,141 -19,33 -31,63 -40,99 -83,335 -223,944 -327,1635 l 0,0 c -2,12 -3,23 -3,36 0,45 10,84 33,123 20,34 43,59 76,81 345,234 1322,801 2711,1122 1021,236 2057,283 2745,153 62,-12 113,-31 168,-62 84,-49 145,-109 193,-194 49,-84 71,-167 71,-265 0,-13 0,-24 -1,-38 z m -2621,-1387 0,0 c -21,19 -36,39 -51,64 -25,43 -36,86 -36,136 0,2 0,3 0,5 l 0,687 0,0 c 0,32 -8,58 -23,86 -16,27 -35,46 -62,62 -28,15 -54,23 -86,23 l -235,0 0,0 c -32,0 -58,-8 -85,-23 -27,-16 -47,-35 -62,-62 -16,-28 -23,-54 -23,-86 l 0,-692 0,0 c -1,-50 -13,-92 -38,-136 -16,-28 -34,-49 -58,-70 l 0,0 c -46,-42 -79,-84 -110,-138 -53,-91 -77,-180 -77,-285 0,-105 24,-194 77,-285 52,-91 118,-156 209,-209 91,-53 180,-76 285,-76 105,0 194,23 285,76 91,53 156,118 209,209 52,91 76,180 76,285 0,105 -24,194 -76,285 -33,57 -68,101 -118,144 l -1,0 z"
id="path68" />
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -23,6 +23,7 @@ import { transactionFieldsActions } from 'features/transaction';
import { notificationsActions } from 'features/notifications';
import LedgerIcon from 'assets/images/wallets/ledger.svg';
import TrezorIcon from 'assets/images/wallets/trezor.svg';
import SafeTIcon from 'assets/images/wallets/safe-t.svg';
import ParitySignerIcon from 'assets/images/wallets/parity-signer.svg';
import { Errorable } from 'components';
import { DisabledWallets } from './disables';
@ -34,6 +35,7 @@ import {
PrivateKeyDecrypt,
PrivateKeyValue,
TrezorDecrypt,
SafeTminiDecrypt,
ViewOnlyDecrypt,
Web3Decrypt,
WalletButton,
@ -141,6 +143,16 @@ const WalletDecrypt = withRouter<Props>(
helpLink:
'https://support.mycrypto.com/accessing-your-wallet/how-to-use-your-trezor-with-mycrypto.html'
},
[SecureWalletName.SAFE_T]: {
lid: 'X_SAFE_T',
icon: SafeTIcon,
description: 'ADD_HARDWAREDESC',
component: SafeTminiDecrypt,
initialParams: {},
unlock: this.props.setWallet,
// TODO - Update with the right id once available
helpLink: 'https://www.archos.com/fr/products/crypto/faq.html'
},
[SecureWalletName.PARITY_SIGNER]: {
lid: 'X_PARITYSIGNER',
icon: ParitySignerIcon,

View File

@ -0,0 +1,31 @@
.SafeTminiDecrypt {
text-align: center;
&-help {
margin-top: 10px;
font-size: 13px;
}
&-error {
opacity: 0;
transition: none;
&.is-showing {
opacity: 1;
}
}
&-buy {
margin: 10px 0;
}
&-message {
display: flex;
justify-content: center;
align-items: center;
.Spinner {
margin-right: 16px;
}
}
}

View File

@ -0,0 +1,153 @@
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { SecureWalletName, safeTReferralURL } from 'config';
import translate, { translateRaw } from 'translations';
import { SafeTWallet } from 'libs/wallet';
import { AppState } from 'features/reducers';
import { getSingleDPath, getPaths } from 'features/config';
import { Spinner, NewTabLink } from 'components/ui';
import UnsupportedNetwork from './UnsupportedNetwork';
import DeterministicWalletsModal from './DeterministicWalletsModal';
import './SafeT.scss';
//todo: conflicts with comment in walletDecrypt -> onUnlock method
interface OwnProps {
onUnlock(param: any): void;
}
interface StateProps {
dPath: DPath | undefined;
dPaths: DPath[];
}
// todo: nearly duplicates ledger component props
interface State {
publicKey: string;
chainCode: string;
dPath: DPath;
error: string | null;
isLoading: boolean;
}
type Props = OwnProps & StateProps;
class SafeTminiDecryptClass extends PureComponent<Props, State> {
public state: State = {
publicKey: '',
chainCode: '',
dPath: this.props.dPath || this.props.dPaths[0],
error: null,
isLoading: false
};
public UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (this.props.dPath !== nextProps.dPath && nextProps.dPath) {
this.setState({ dPath: nextProps.dPath });
}
}
public render() {
const { dPath, publicKey, chainCode, error, isLoading } = this.state;
const showErr = error ? 'is-showing' : '';
if (!dPath) {
return <UnsupportedNetwork walletType={translateRaw('X_SAFE_T')} />;
}
// todo: update help link
return (
<div className="SafeTminiDecrypt">
<button
className="SafeTminiDecrypt-decrypt btn btn-primary btn-lg btn-block"
onClick={this.handleNullConnect}
disabled={isLoading}
>
{isLoading ? (
<div className="SafeTminiDecrypt-message">
<Spinner light={true} />
{translate('WALLET_UNLOCKING')}
</div>
) : (
translate('ADD_SAFE_T_SCAN')
)}
</button>
<NewTabLink className="SafeTminiDecrypt-buy btn btn-sm btn-default" href={safeTReferralURL}>
{translate('ORDER_SAFE_T')}
</NewTabLink>
<div className={`SafeTminiDecrypt-error alert alert-danger ${showErr}`}>{error || '-'}</div>
<DeterministicWalletsModal
isOpen={!!publicKey && !!chainCode}
publicKey={publicKey}
chainCode={chainCode}
dPath={dPath}
dPaths={this.props.dPaths}
onCancel={this.handleCancel}
onConfirmAddress={this.handleUnlock}
onPathChange={this.handlePathChange}
/>
</div>
);
}
private handlePathChange = (dPath: DPath) => {
this.setState({ dPath });
this.handleConnect(dPath);
};
private handleConnect = (dPath: DPath): void => {
this.setState({
isLoading: true,
error: null
});
SafeTWallet.getChainCode(dPath.value)
.then(res => {
this.setState({
dPath,
publicKey: res.publicKey,
chainCode: res.chainCode,
isLoading: false
});
})
.catch(err => {
this.setState({
error: err.message,
isLoading: false
});
});
};
private handleCancel = () => {
this.reset();
};
private handleUnlock = (address: string, index: number) => {
this.props.onUnlock(new SafeTWallet(address, this.state.dPath.value, index));
this.reset();
};
private handleNullConnect = (): void => {
this.handleConnect(this.state.dPath);
};
private reset() {
this.setState({
publicKey: '',
chainCode: '',
dPath: this.props.dPath || this.props.dPaths[0]
});
}
}
function mapStateToProps(state: AppState): StateProps {
return {
dPath: getSingleDPath(state, SecureWalletName.SAFE_T),
dPaths: getPaths(state, SecureWalletName.SAFE_T)
};
}
export const SafeTminiDecrypt = connect(mapStateToProps)(SafeTminiDecryptClass);

View File

@ -30,7 +30,7 @@
animation: wallet-button-enter 400ms ease 1;
animation-fill-mode: backwards;
@for $i from 0 to 5 {
@for $i from 0 to 6 {
&:nth-child(#{$i}) {
animation-delay: 100ms + ($i * 60ms);
}

View File

@ -7,6 +7,7 @@ export * from './Mnemonic';
export * from './ParitySigner';
export * from './PrivateKey';
export * from './Trezor';
export * from './SafeT';
export * from './ViewOnly';
export * from './WalletButton';
export * from './Web3';

View File

@ -22,9 +22,10 @@ export const DISABLE_WALLETS: { [key in WalletMode]: DisabledWallets } = {
}
},
[WalletMode.UNABLE_TO_SIGN]: {
wallets: [SecureWalletName.TREZOR, MiscWalletName.VIEW_ONLY],
wallets: [SecureWalletName.TREZOR, SecureWalletName.SAFE_T, MiscWalletName.VIEW_ONLY],
reasons: {
[SecureWalletName.TREZOR]: 'This wallet cant sign messages',
[SecureWalletName.SAFE_T]: 'This wallet cant sign messages',
[MiscWalletName.VIEW_ONLY]: 'This wallet cant sign messages'
}
}

View File

@ -55,6 +55,9 @@ export const MINIMUM_PASSWORD_LENGTH = 12;
export const knowledgeBaseURL = 'https://support.mycrypto.com';
export const ledgerReferralURL = 'https://www.ledgerwallet.com/r/1985?path=/products/';
export const trezorReferralURL = 'https://shop.trezor.io?a=mycrypto.com';
// TODO - Update url
export const safeTReferralURL =
'https://www.archos.com/fr/products/crypto/archos_safetmini/index.html';
export const bitboxReferralURL = 'https://digitalbitbox.com/?ref=mycrypto';
// TODO - Update url, this is MEW's
export const bityReferralURL = 'https://bity.com/af/jshkb37v';
@ -69,12 +72,14 @@ export enum SecureWalletName {
WEB3 = 'web3',
LEDGER_NANO_S = 'ledgerNanoS',
TREZOR = 'trezor',
SAFE_T = 'safeTmini',
PARITY_SIGNER = 'paritySigner'
}
export enum HardwareWalletName {
LEDGER_NANO_S = 'ledgerNanoS',
TREZOR = 'trezor'
TREZOR = 'trezor',
SAFE_T = 'safeTmini'
}
export enum InsecureWalletName {

View File

@ -8,6 +8,11 @@ export const ETH_TREZOR: DPath = {
value: "m/44'/60'/0'/0"
};
export const ETH_SAFE_T: DPath = {
label: 'Safe-T (ETH)',
value: "m/44'/60'/0'/0"
};
export const ETH_LEDGER: DPath = {
label: 'Ledger (ETH)',
value: "m/44'/60'/0'"
@ -23,6 +28,11 @@ export const ETC_TREZOR: DPath = {
value: "m/44'/61'/0'/0"
};
export const ETC_SAFE_T: DPath = {
label: 'Safe-T (ETC)',
value: "m/44'/61'/0'/0"
};
export const ETH_TESTNET: DPath = {
label: 'Testnet (ETH)',
value: "m/44'/1'/0'/0"
@ -106,9 +116,11 @@ export const ESN_DEFAULT: DPath = {
export const DPaths: DPath[] = [
ETH_DEFAULT,
ETH_TREZOR,
ETH_SAFE_T,
ETH_LEDGER,
ETC_LEDGER,
ETC_TREZOR,
ETC_SAFE_T,
ETH_TESTNET,
EXP_DEFAULT,
UBQ_DEFAULT,

View File

@ -3,6 +3,7 @@ import {
discordURL,
ledgerReferralURL,
trezorReferralURL,
safeTReferralURL,
ethercardReferralURL,
keepkeyReferralURL,
steelyReferralURL
@ -84,6 +85,10 @@ export const affiliateLinks: Link[] = [
link: trezorReferralURL,
text: translateRaw('TREZOR_REFERAL')
},
{
link: safeTReferralURL,
text: translateRaw('SAFE_T_REFERAL')
},
{
link: keepkeyReferralURL,
text: translateRaw('KEEPKEY_REFERRAL')

View File

@ -18,6 +18,7 @@ interface Props {
signMessageRequested: messageActions.TSignMessageRequested;
signedMessage: ISignedMessage | null;
resetWallet: walletActions.TResetWallet;
resetMessage: messageActions.TResetMessage;
}
interface State {
@ -35,6 +36,7 @@ export class SignMessage extends Component<Props, State> {
public componentWillUnmount() {
this.props.resetWallet();
this.props.resetMessage();
}
public render() {
@ -97,6 +99,8 @@ export class SignMessage extends Component<Props, State> {
private changeWallet = () => {
this.props.resetWallet();
this.props.resetMessage();
this.setState(initialState);
};
}
@ -107,5 +111,6 @@ const mapStateToProps = (state: AppState) => ({
export default connect(mapStateToProps, {
signMessageRequested: messageActions.signMessageRequested,
resetWallet: walletActions.resetWallet
resetWallet: walletActions.resetWallet,
resetMessage: messageActions.resetMessage
})(SignMessage);

View File

@ -9,10 +9,12 @@ import {
ELLA_DEFAULT,
ETC_LEDGER,
ETC_TREZOR,
ETC_SAFE_T,
ETH_DEFAULT,
ETH_LEDGER,
ETH_TESTNET,
ETH_TREZOR,
ETH_SAFE_T,
EXP_DEFAULT,
POA_DEFAULT,
TOMO_DEFAULT,
@ -57,6 +59,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: require('config/contracts/eth.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: ETH_TREZOR,
[SecureWalletName.SAFE_T]: ETH_SAFE_T,
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: ETH_DEFAULT
},
@ -79,6 +82,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
isTestnet: true,
dPathFormats: {
[SecureWalletName.TREZOR]: ETH_TESTNET,
[SecureWalletName.SAFE_T]: ETH_TESTNET,
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: ETH_TESTNET
},
@ -100,6 +104,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
isTestnet: true,
dPathFormats: {
[SecureWalletName.TREZOR]: ETH_TESTNET,
[SecureWalletName.SAFE_T]: ETH_TESTNET,
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: ETH_TESTNET
},
@ -121,6 +126,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
isTestnet: true,
dPathFormats: {
[SecureWalletName.TREZOR]: ETH_TESTNET,
[SecureWalletName.SAFE_T]: ETH_TESTNET,
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: ETH_TESTNET
},
@ -142,6 +148,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: require('config/contracts/etc.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: ETC_TREZOR,
[SecureWalletName.SAFE_T]: ETC_SAFE_T,
[SecureWalletName.LEDGER_NANO_S]: ETC_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: ETC_TREZOR
},
@ -166,6 +173,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: require('config/contracts/ubq.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: UBQ_DEFAULT,
[SecureWalletName.SAFE_T]: UBQ_DEFAULT,
[SecureWalletName.LEDGER_NANO_S]: UBQ_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: UBQ_DEFAULT
},
@ -190,6 +198,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: require('config/contracts/exp.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: EXP_DEFAULT,
[SecureWalletName.SAFE_T]: EXP_DEFAULT,
[SecureWalletName.LEDGER_NANO_S]: EXP_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: EXP_DEFAULT
},
@ -216,6 +225,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: POA_DEFAULT,
[SecureWalletName.SAFE_T]: POA_DEFAULT,
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[InsecureWalletName.MNEMONIC_PHRASE]: POA_DEFAULT
},
@ -241,6 +251,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
dPathFormats: {
[SecureWalletName.LEDGER_NANO_S]: ETH_LEDGER,
[SecureWalletName.TREZOR]: ETH_TREZOR,
[SecureWalletName.SAFE_T]: ETH_SAFE_T,
[SecureWalletName.LEDGER_NANO_S]: TOMO_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: TOMO_DEFAULT
},
@ -265,6 +276,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: ELLA_DEFAULT,
[SecureWalletName.SAFE_T]: ELLA_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: ELLA_DEFAULT
},
gasPriceSettings: {
@ -290,6 +302,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: MUSIC_DEFAULT,
[SecureWalletName.SAFE_T]: MUSIC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: MUSIC_DEFAULT
},
gasPriceSettings: {
@ -314,6 +327,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: ETSC_DEFAULT,
[SecureWalletName.SAFE_T]: ETSC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: ETSC_DEFAULT
},
gasPriceSettings: {
@ -338,6 +352,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: EGEM_DEFAULT,
[SecureWalletName.SAFE_T]: EGEM_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: EGEM_DEFAULT
},
gasPriceSettings: {
@ -362,6 +377,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: CLO_DEFAULT,
[SecureWalletName.SAFE_T]: CLO_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: CLO_DEFAULT
},
gasPriceSettings: {
@ -414,6 +430,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
isTestnet: true,
dPathFormats: {
[SecureWalletName.TREZOR]: RSK_TESTNET,
[SecureWalletName.SAFE_T]: RSK_TESTNET,
[SecureWalletName.LEDGER_NANO_S]: RSK_TESTNET,
[InsecureWalletName.MNEMONIC_PHRASE]: RSK_TESTNET
},
@ -440,6 +457,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: GO_DEFAULT,
[SecureWalletName.SAFE_T]: GO_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: GO_DEFAULT
},
gasPriceSettings: {
@ -464,6 +482,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: EOSC_DEFAULT,
[SecureWalletName.SAFE_T]: EOSC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: EOSC_DEFAULT
},
gasPriceSettings: {
@ -487,6 +506,7 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
contracts: require('config/contracts/esn.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: ESN_DEFAULT,
[SecureWalletName.SAFE_T]: ESN_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: ESN_DEFAULT
},
gasPriceSettings: {

View File

@ -158,6 +158,7 @@ export function isWalletFormatSupportedOnNetwork(state: AppState, format: Wallet
const CHECK_FORMATS: types.DPathFormat[] = [
SecureWalletName.LEDGER_NANO_S,
SecureWalletName.TREZOR,
SecureWalletName.SAFE_T,
InsecureWalletName.MNEMONIC_PHRASE
];

View File

@ -33,5 +33,6 @@ export type ConfigAction =
export type DPathFormat =
| SecureWalletName.TREZOR
| SecureWalletName.SAFE_T
| SecureWalletName.LEDGER_NANO_S
| InsecureWalletName.MNEMONIC_PHRASE;

View File

@ -25,3 +25,10 @@ export function signMessageFailed(): types.SignMessageFailedAction {
type: types.MessageActions.SIGN_FAILED
};
}
export type TResetMessage = typeof resetMessage;
export function resetMessage(): types.ResetMessageAction {
return {
type: types.MessageActions.RESET
};
}

View File

@ -21,6 +21,12 @@ function signMessageFailed(state: types.MessageState): types.MessageState {
};
}
function resetMessage(): types.MessageState {
return {
...INITIAL_STATE
};
}
export function messageReducer(
state: types.MessageState = INITIAL_STATE,
action: types.MessageAction
@ -30,6 +36,8 @@ export function messageReducer(
return signLocalMessageSucceeded(state, action);
case types.MessageActions.SIGN_FAILED:
return signMessageFailed(state);
case types.MessageActions.RESET:
return resetMessage();
default:
return state;
}

View File

@ -3,7 +3,8 @@ import { ISignedMessage } from 'libs/signing';
export enum MessageActions {
SIGN_REQUESTED = 'MESSAGE_SIGN_REQUESTED',
SIGN_LOCAL_SUCCEEDED = 'MESSAGE_SIGN_LOCAL_SUCCEEDED',
SIGN_FAILED = 'MESSAGE_SIGN_FAILED'
SIGN_FAILED = 'MESSAGE_SIGN_FAILED',
RESET = 'MESSAGE_RESET'
}
export interface MessageState {
@ -24,7 +25,12 @@ export interface SignMessageFailedAction {
type: MessageActions.SIGN_FAILED;
}
export interface ResetMessageAction {
type: MessageActions.RESET;
}
export type MessageAction =
| SignMessageRequestedAction
| SignLocalMessageSucceededAction
| SignMessageFailedAction;
| SignMessageFailedAction
| ResetMessageAction;

View File

@ -69,7 +69,7 @@ export function getDisabledWallets(state: AppState): any {
// Some wallets are unavailable offline
if (isOffline) {
addReason(
[SecureWalletName.WEB3, SecureWalletName.TREZOR],
[SecureWalletName.WEB3, SecureWalletName.TREZOR, SecureWalletName.SAFE_T],
'This wallet cannot be accessed offline'
);
}
@ -77,6 +77,10 @@ export function getDisabledWallets(state: AppState): any {
// Some wallets are disabled on certain platforms
if (process.env.BUILD_ELECTRON) {
addReason([SecureWalletName.WEB3], 'This wallet is not supported in the MyCrypto app');
addReason(
[SecureWalletName.SAFE_T],
'Coming soon. Please use the MyCrypto.com website in the meantime'
);
}
// Dedupe and sort for consistency

View File

@ -3,6 +3,7 @@ import { WalletConfig } from 'libs/wallet/config';
import { IWallet } from 'libs/wallet/IWallet';
import { LedgerWallet } from 'libs/wallet/deterministic/ledger';
import { TrezorWallet } from 'libs/wallet/deterministic/trezor';
import { SafeTWallet } from 'libs/wallet/deterministic/safe-t';
import Web3Wallet from 'libs/wallet/non-deterministic/web3';
import ParitySignerWallet from 'libs/wallet/non-deterministic/parity';
import { AppState } from 'features/reducers';
@ -32,8 +33,9 @@ export const getWalletType = (state: AppState): IWalletType => {
const isWeb3Wallet = wallet instanceof Web3Wallet;
const isLedgerWallet = wallet instanceof LedgerWallet;
const isTrezorWallet = wallet instanceof TrezorWallet;
const isSafeTWallet = wallet instanceof SafeTWallet;
const isParitySignerWallet = wallet instanceof ParitySignerWallet;
const isHardwareWallet = isLedgerWallet || isTrezorWallet;
const isHardwareWallet = isLedgerWallet || isTrezorWallet || isSafeTWallet;
return { isWeb3Wallet, isHardwareWallet, isParitySignerWallet };
};

View File

@ -9,6 +9,7 @@ import { HardwareWallet, ChainCodeResponse } from './hardware';
const walletTypeNames = {
[WalletTypes.LEDGER]: 'X_LEDGER',
[WalletTypes.TREZOR]: 'X_TREZOR',
[WalletTypes.SAFE_T]: 'X_SAFE_T',
[WalletTypes.KEEPKEY]: 'X_KEEPKEY'
};

View File

@ -2,6 +2,7 @@ import { WalletTypes } from 'shared/enclave/client';
import { makeEnclaveWallet } from './enclave';
import { LedgerWallet as LedgerWalletWeb } from './ledger';
import { TrezorWallet as TrezorWalletWeb } from './trezor';
import { SafeTWallet as SafeTWalletWeb } from './safe-t';
function enclaveOrWallet<T>(type: WalletTypes, lib: T) {
return process.env.BUILD_ELECTRON ? makeEnclaveWallet(type) : lib;
@ -11,3 +12,4 @@ export * from './mnemonic';
export * from './hardware';
export const LedgerWallet = enclaveOrWallet(WalletTypes.LEDGER, LedgerWalletWeb);
export const TrezorWallet = enclaveOrWallet(WalletTypes.TREZOR, TrezorWalletWeb);
export const SafeTWallet = enclaveOrWallet(WalletTypes.SAFE_T, SafeTWalletWeb);

View File

@ -0,0 +1,116 @@
import BN from 'bn.js';
import EthTx, { TxObj } from 'ethereumjs-tx';
import { addHexPrefix } from 'ethereumjs-util';
import mapValues from 'lodash/mapValues';
import { translateRaw } from 'translations';
import SafeTConnect from 'vendor/safe-t-connect';
import { getTransactionFields } from 'libs/transaction';
import { padLeftEven } from 'libs/values';
import { stripHexPrefixAndLower } from 'libs/formatters';
import { HardwareWallet, ChainCodeResponse } from './hardware';
export const SAFE_T_MINIMUM_FIRMWARE = '1.0.0';
export class SafeTWallet extends HardwareWallet {
public static getChainCode(dpath: string): Promise<ChainCodeResponse> {
return new Promise(resolve => {
SafeTConnect.getXPubKey(
dpath,
res => {
if (res.success) {
resolve({
publicKey: res.publicKey,
chainCode: res.chainCode
});
} else {
throw new Error(res.error);
}
},
SAFE_T_MINIMUM_FIRMWARE
);
});
}
public signRawTransaction(tx: EthTx): Promise<Buffer> {
return new Promise((resolve, reject) => {
const { chainId, ...strTx } = getTransactionFields(tx);
// stripHexPrefixAndLower identical to ethFuncs.getNakedAddress
const cleanedTx = mapValues(mapValues(strTx, stripHexPrefixAndLower), padLeftEven);
SafeTConnect.ethereumSignTx(
// Args
this.getPath(),
cleanedTx.nonce,
cleanedTx.gasPrice,
cleanedTx.gasLimit,
cleanedTx.to,
cleanedTx.value,
cleanedTx.data,
chainId,
// Callback
result => {
if (!result.success) {
return reject(Error(result.error));
}
// TODO: Explain what's going on here? Add tests? Adapted from:
// https://github.com/kvhnuke/etherwallet/blob/v3.10.2.6/app/scripts/uiFuncs.js#L24
const txToSerialize: TxObj = {
...strTx,
v: addHexPrefix(new BN(result.v).toString(16)),
r: addHexPrefix(result.r.toString()),
s: addHexPrefix(result.s)
};
const eTx = new EthTx(txToSerialize);
const serializedTx = eTx.serialize();
resolve(serializedTx);
}
);
});
}
public signMessage() {
return Promise.reject(new Error('Signing via Safe-T mini not yet supported.'));
}
public displayAddress(): Promise<boolean> {
return new Promise(resolve => {
SafeTConnect.ethereumGetAddress(
`${this.dPath}/${this.index}`,
res => {
if (res.error) {
resolve(false);
} else {
resolve(true);
}
},
SAFE_T_MINIMUM_FIRMWARE
);
});
}
public getWalletType(): string {
return translateRaw('X_SAFE_T');
}
// works, but returns a signature that can only be verified with a Safe-T mini device
/*
public signMessage = (message: string): Promise<string> => {
return new Promise((resolve, reject) => {
SafeTConnect.ethereumSignMessage(
this.getPath(),
message,
response => {
if (response.success) {
resolve(addHexPrefix(response.signature))
} else{
console.error(response.error)
reject(response.error)
}
}
)
})
}
*/
}

View File

@ -282,6 +282,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connexion au TREZOR ",
"ADD_TREZOR_SELECT": "Ceci est une _seed_ TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connexion au Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Réouvrir MyCrypto sur une connexion sécurisée (SSL) ",
"ADD_DIGITALBITBOX_0B": "Réouvrir MyCrypto avec [Chrome](https://www.google.com/chrome/browser/desktop/) ou [Opera](https://www.opera.com/) ",

View File

@ -295,6 +295,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Zu TREZOR Verbinden ",
"ADD_TREZOR_SELECT": "Dies ist ein TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Zu Safe-T mini Verbinden ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -296,6 +296,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Συνδεθείτε στο TREZOR ",
"ADD_TREZOR_SELECT": "Αυτός είναι σπόρος του TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Συνδεθείτε στο Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -81,6 +81,9 @@
"ORDER_TREZOR": "Dont have a TREZOR? Order one now!",
"HOWTO_TREZOR": "How to use TREZOR with MyCrypto",
"X_KEEPKEY": "KeepKey",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"ORDER_SAFE_T": "Dont have a Safe-T mini? Order one now!",
"UNLOCK_WALLET": "Unlock your",
"X_PARITYSIGNER": "Parity Signer ",
"ADD_PARITY_DESC": "Connect & sign via your Parity Signer mobile app ",
@ -460,6 +463,7 @@
"LEDGER_WRONG_APP": "Wrong application selected on your device",
"LEDGER_LOCKED": "Your Ledger device is locked",
"TREZOR_REFERAL": "Buy a TREZOR",
"SAFE_T_REFERAL": "Buy a Safe-T mini",
"KEEPKEY_REFERRAL": "Buy a Keepkey",
"STEELY_REFERRAL": "Get a Steely",
"ETHERCARD_REFERAL": "Get an ether.card",

View File

@ -295,6 +295,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Conectar a TREZOR ",
"ADD_TREZOR_SELECT": "Esto es una semilla TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Conectar a Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Volver a abrir MyCrypto en una conexión segura (SSL) ",
"ADD_DIGITALBITBOX_0B": "Volver a abrir MyCrypto usando [Chrome](https://www.google.com/chrome/browser/desktop/) u [Opera](https://www.opera.com/) ",

View File

@ -296,6 +296,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -80,6 +80,9 @@
"ADD_TREZOR_SCAN": "Connexion au TREZOR ",
"ORDER_TREZOR": "Pas de TREZOR ? Achetez-en un maintenant !",
"HOWTO_TREZOR": "Comment utiliser TREZOR avec MyCrypto",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connexion au Safe-T mini ",
"ORDER_SAFE_T": "Pas de Safe-T mini ? Achetez-en un maintenant !",
"X_KEEPKEY": "KeepKey",
"UNLOCK_WALLET": "Déverrouillez votre",
"X_PARITYSIGNER": "Parity Signer ",
@ -460,6 +463,7 @@
"LEDGER_WRONG_APP": "Mauvaise application sélectionnée sur votre appareil",
"LEDGER_LOCKED": "Votre appareil Ledger est verrouillé",
"TREZOR_REFERAL": "Acheter un TREZOR",
"SAFE_T_REFERAL": "Acheter un Safe-T mini",
"KEEPKEY_REFERRAL": "Acheter un Keepkey",
"STEELY_REFERRAL": "Acheter un Steely",
"ETHERCARD_REFERAL": "Acheter une ether.card",

View File

@ -136,6 +136,8 @@
"ADD_METAMASK": "Connect to MetaMask ",
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -296,6 +296,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"ADD_METAMASK": "Connect to MetaMask ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",

View File

@ -160,6 +160,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Hubungkan ke TREZOR ",
"ADD_TREZOR_SELECT": "Ini adalah TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Hubungkan ke Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Buka kembali MyCrypto melalui koneksi (SSL) yang aman ",
"ADD_DIGITALBITBOX_0B": "Buka kembali MyCrypto menggunakan [Chrome](https://www.google.com/chrome/browser/desktop/) atau [Opera](https://www.opera.com/) ",

View File

@ -244,6 +244,8 @@
"ADD_METAMASK": "Collegati a MetaMask ",
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Collegati al TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Collegati al Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Riapri MyCrypto su una connessione sicura (SSL) ",
"ADD_DIGITALBITBOX_0B": "Riapri MyCrypto utilizzando [Chrome](https://www.google.com/chrome/browser/desktop/) o [Opera](https://www.opera.com/) ",

View File

@ -61,6 +61,8 @@
"ADD_METAMASK": "MetaMaskに接続 ",
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "TREZORに接続する ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Safe-T miniに接続する ",
"X_PARITYSIGNER": "Parity Signer ",
"ADD_PARITY_DESC": "Parity Signerモバイルアプリ経由で接続て署名 ",
"ADD_PARITY_1": "処理が取り消されました ",
@ -394,6 +396,7 @@
"LEDGER_WRONG_APP": "デバイス上で誤ったアプリが選択されています。",
"LEDGER_LOCKED": "Ledgerデバイスがロックされています",
"TREZOR_REFERAL": "TREZORを購入",
"SAFE_T_REFERAL": "Safe-T miniを購入",
"KEEPKEY_REFERRAL": "Keepkeyを購入",
"STEELY_REFERRAL": "Steelyを購入",
"ETHERCARD_REFERAL": "ether.cardを購入",

View File

@ -78,6 +78,8 @@
"X_HARDWARE_WALLET": "하드웨어 지갑",
"X_HARDWARE_WALLET_2": "하드웨어 지갑 ",
"ADD_TREZOR_SCAN": "TREZOR에 연결하기 ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Safe-T mini 에 연결하기 ",
"X_KEEPKEY": "KeepKey 지갑",
"X_PARITYSIGNER": "Parity Signer ",
"ADD_PARITY_DESC": "Parity Signer 모바일 앱을 통해 연결 및 서명 ",

View File

@ -134,6 +134,8 @@
"ADD_LEDGER_SCAN": "Verbind met Ledger Wallet ",
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Verbind met TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Verbind met Safe-T mini ",
"ADD_METAMASK": "Verbind met MetaMask ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Her-open MyCrypto met een veilige (SSL) verbinding ",

View File

@ -155,6 +155,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Koble til TREZOR ",
"ADD_TREZOR_SELECT": "Dette er en TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Koble til Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Åpne MyCrypto på nytt på en sikker (SSL) forbindelse. ",
"ADD_DIGITALBITBOX_0B": "Åpne MyCrypto på nytt med [Chrome](https://www.google.com/chrome/browser/desktop/) eller [Opera](https://www.opera.com/) ",

View File

@ -259,6 +259,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Połącz z TREZOR ",
"ADD_TREZOR_SELECT": "To jest ziarno (seed) TREZOR",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Połącz z Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Otwórz MyCrypto ponownie na bezpiecznym połączeniu (SSL) ",
"ADD_DIGITALBITBOX_0B": "Otwórz MyCrypto w [Chrome](https://www.google.com/chrome/browser/desktop/) lub [Opera](https://www.opera.com/) ",

View File

@ -249,6 +249,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-abra MyCrypto em uma conexão (SSL) segura ",
"ADD_DIGITALBITBOX_0B": "Re-abra MyCrypto usando [Chrome](https://www.google.com/chrome/browser/desktop/) ou [Opera](https://www.opera.com/) ",

View File

@ -297,6 +297,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Подключиться к TREZOR ",
"ADD_TREZOR_SELECT": "Это код восстановления TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Подключиться к Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Перезапустите MyCrypto через безопасное (SSL) соединение ",
"ADD_DIGITALBITBOX_0B": "Перезапустите MyCrypto с браузере [Chrome](https://www.google.com/chrome/browser/desktop/) или [Opera](https://www.opera.com/) ",

View File

@ -292,6 +292,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B":

View File

@ -159,6 +159,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -136,6 +136,8 @@
"ADD_METAMASK": "Connect to MetaMask ",
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -289,6 +289,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "TREZOR'a bağlan ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Safe-T mini'a bağlan ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -256,6 +256,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_LEDGER": "Ledger ",
"ADD_LEDGER_1": "Kết Nối Với Ledger Wallet Của Bạn ",
"ADD_LEDGER_2": "Mở Lên Ứng Dụng Của Ethereum (Hoặc một ứng dụng của Hợp Đồng) ",

View File

@ -296,6 +296,8 @@
"X_TREZOR": "TREZOR ",
"ADD_TREZOR_SCAN": "Connect to TREZOR ",
"ADD_TREZOR_SELECT": "This is a TREZOR seed ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "Connect to Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "Re-open MyCrypto using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ",

View File

@ -136,6 +136,8 @@
"ADD_METAMASK": "Connect to MetaMask ",
"X_TREZOR": "TREZOR 錢包 ",
"ADD_TREZOR_SCAN": "連接至 TREZOR ",
"X_SAFE_T": "Safe-T mini ",
"ADD_SAFE_T_SCAN": "連接至 Safe-T mini ",
"X_DIGITALBITBOX": "Digital Bitbox ",
"ADD_DIGITALBITBOX_0A": "Re-open MyCrypto on a secure (SSL) connection ",
"ADD_DIGITALBITBOX_0B": "以 [Chrome](https://www.google.com/chrome/browser/desktop/) 或 [Opera](https://www.opera.com/) 瀏覽器重新開啟MyCrypto",

69
common/typescript/safe-t-connect.d.ts vendored Normal file
View File

@ -0,0 +1,69 @@
declare module 'vendor/safe-t-connect' {
type Path = number[] | string;
interface TxSignature {
r: number;
s: string;
v: string;
}
interface MessageSignature {
signature: string;
address: string;
}
interface PublicKey {
xpubkey: string;
path: string;
serializedPath: string;
chainCode: string;
publicKey: string;
}
interface ErrorResponse {
success: false;
error: string;
}
type SuccessResponse<T> = {
success: true;
error: undefined;
} & T;
type Response<T> = ErrorResponse | SuccessResponse<T>;
namespace SafeTConnect {
export function getXPubKey(
path: Path,
cb: (res: Response<PublicKey>) => void,
minFirmware?: string
): void;
export function ethereumSignTx(
path: Path,
nonce: string,
gasPrice: string,
gasLimit: string,
to: string,
value: string,
data: string | null,
chainId: number | null,
cb: (signature: Response<TxSignature>) => void,
minFirmware?: string
): void;
export function signMessage(
path: Path,
message: string,
cb: (res: Response<MessageSignature>) => void,
coin?: string,
minFirmware?: string
): void;
export function ethereumGetAddress(
path: Path,
cb: (res: Response<{ address: string }>) => void,
minFirmware?: string
): void;
}
export default SafeTConnect;
}

1012
common/vendor/safe-t-connect.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ pipeline {
S3_BUCKET_NAME = 'REDACTED'
}
steps {
sh 'npm run jenkins:build:linux'
sh 'yarn run jenkins:build:linux'
}
}
stage('Upload') {

View File

@ -1,7 +1,7 @@
{
"name": "MyCrypto",
"author": "MyCryptoHQ",
"version": "1.2.0",
"version": "1.2.2",
"main": "main.js",
"description": "MyCrypto web and electron app",
"repository": "https://github.com/MyCryptoHQ/MyCrypto",

View File

@ -1,11 +1,13 @@
import { WalletTypes, WalletLib } from 'shared/enclave/types';
import Ledger from './ledger';
import Trezor from './trezor';
import SafeT from './safe-t';
import KeepKey from './keepkey';
export const wallets: { [key in WalletTypes]: WalletLib } = {
[WalletTypes.LEDGER]: Ledger,
[WalletTypes.TREZOR]: Trezor,
[WalletTypes.SAFE_T]: SafeT,
[WalletTypes.KEEPKEY]: KeepKey
};

View File

@ -0,0 +1,21 @@
import { WalletLib } from 'shared/enclave/types';
const SafeT: WalletLib = {
async getChainCode() {
throw new Error('Not yet implemented');
},
async signTransaction() {
throw new Error('Not yet implemented');
},
async signMessage() {
throw new Error('Not yet implemented');
},
async displayAddress() {
throw new Error('Not yet implemented');
}
};
export default SafeT;

View File

@ -9,6 +9,7 @@ export enum EnclaveMethods {
export enum WalletTypes {
LEDGER = 'ledger',
TREZOR = 'trezor',
SAFE_T = 'safe-t',
KEEPKEY = 'keepkey'
}

View File

@ -44,6 +44,7 @@ interface NetworkContract {
interface DPathFormats {
trezor?: DPath;
safeTmini?: DPath;
ledgerNanoS?: DPath;
mnemonicPhrase: DPath;
}