+
+
+
+ {translate('ORDER_SAFE_T')}
+
+
+
{error || '-'}
+
+
+
+ );
+ }
+
+ 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);
diff --git a/common/components/WalletDecrypt/components/WalletButton.scss b/common/components/WalletDecrypt/components/WalletButton.scss
index a093d70f..bc8ed86f 100644
--- a/common/components/WalletDecrypt/components/WalletButton.scss
+++ b/common/components/WalletDecrypt/components/WalletButton.scss
@@ -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);
}
diff --git a/common/components/WalletDecrypt/components/index.tsx b/common/components/WalletDecrypt/components/index.tsx
index c2aed00d..9efd6af7 100644
--- a/common/components/WalletDecrypt/components/index.tsx
+++ b/common/components/WalletDecrypt/components/index.tsx
@@ -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';
diff --git a/common/components/WalletDecrypt/disables.ts b/common/components/WalletDecrypt/disables.ts
index 3ed1fde3..6188a25b 100644
--- a/common/components/WalletDecrypt/disables.ts
+++ b/common/components/WalletDecrypt/disables.ts
@@ -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 can’t sign messages',
+ [SecureWalletName.SAFE_T]: 'This wallet can’t sign messages',
[MiscWalletName.VIEW_ONLY]: 'This wallet can’t sign messages'
}
}
diff --git a/common/config/data.tsx b/common/config/data.tsx
index aa9820fe..155d1492 100644
--- a/common/config/data.tsx
+++ b/common/config/data.tsx
@@ -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 {
diff --git a/common/config/dpaths.ts b/common/config/dpaths.ts
index 5af627f2..544b0c4a 100644
--- a/common/config/dpaths.ts
+++ b/common/config/dpaths.ts
@@ -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,
diff --git a/common/config/links.ts b/common/config/links.ts
index 3e5c979c..0b35dda9 100644
--- a/common/config/links.ts
+++ b/common/config/links.ts
@@ -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')
diff --git a/common/features/config/networks/static/reducer.ts b/common/features/config/networks/static/reducer.ts
index edb903e2..b68a3b24 100644
--- a/common/features/config/networks/static/reducer.ts
+++ b/common/features/config/networks/static/reducer.ts
@@ -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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
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: StaticNetworksState = {
contracts: require('config/contracts/esn.json'),
dPathFormats: {
[SecureWalletName.TREZOR]: ESN_DEFAULT,
+ [SecureWalletName.SAFE_T]: ESN_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: ESN_DEFAULT
},
gasPriceSettings: {
diff --git a/common/features/config/selectors.ts b/common/features/config/selectors.ts
index 14ec8d9a..db6547a6 100644
--- a/common/features/config/selectors.ts
+++ b/common/features/config/selectors.ts
@@ -158,6 +158,7 @@ export function isWalletFormatSupportedOnNetwork(state: AppState, format: Wallet
const CHECK_FORMATS: DPathFormat[] = [
SecureWalletName.LEDGER_NANO_S,
SecureWalletName.TREZOR,
+ SecureWalletName.SAFE_T,
InsecureWalletName.MNEMONIC_PHRASE
];
diff --git a/common/features/config/types.ts b/common/features/config/types.ts
index ceb1cdaf..f2ae1ab3 100644
--- a/common/features/config/types.ts
+++ b/common/features/config/types.ts
@@ -27,5 +27,6 @@ export type ConfigAction = CustomNetworkAction | CustomNodeAction | NodeAction |
export type DPathFormat =
| SecureWalletName.TREZOR
+ | SecureWalletName.SAFE_T
| SecureWalletName.LEDGER_NANO_S
| InsecureWalletName.MNEMONIC_PHRASE;
diff --git a/common/features/selectors.ts b/common/features/selectors.ts
index 192138e0..bd5ceb98 100644
--- a/common/features/selectors.ts
+++ b/common/features/selectors.ts
@@ -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
diff --git a/common/features/wallet/selectors.ts b/common/features/wallet/selectors.ts
index 9e00ea11..f355468c 100644
--- a/common/features/wallet/selectors.ts
+++ b/common/features/wallet/selectors.ts
@@ -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 };
};
diff --git a/common/libs/wallet/deterministic/enclave.ts b/common/libs/wallet/deterministic/enclave.ts
index bc3cce5d..feceee88 100644
--- a/common/libs/wallet/deterministic/enclave.ts
+++ b/common/libs/wallet/deterministic/enclave.ts
@@ -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'
};
diff --git a/common/libs/wallet/deterministic/index.ts b/common/libs/wallet/deterministic/index.ts
index 7867bf69..e011f7b6 100644
--- a/common/libs/wallet/deterministic/index.ts
+++ b/common/libs/wallet/deterministic/index.ts
@@ -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