// @flow import React, { Component } from 'react'; import translate from 'translations'; import { isValidPrivKey } from 'libs/validators'; import type { PrivateKeyUnlockParams } from 'libs/wallet/privkey'; export type PrivateKeyValue = PrivateKeyUnlockParams & { valid: boolean }; function fixPkey(key) { if (key.indexOf('0x') === 0) { return key.slice(2); } return key; } export default class PrivateKeyDecrypt extends Component { props: { value: PrivateKeyUnlockParams, onChange: (value: PrivateKeyUnlockParams) => void, onUnlock: () => void }; render() { const { key, password } = this.props.value; const fixedPkey = fixPkey(key); const isValid = isValidPrivKey(fixedPkey.length); const isPassRequired = fixedPkey.length > 64; return (

{translate('ADD_Radio_3')}