diff --git a/CHANGELOG.md b/CHANGELOG.md
index 85fac2c18d..41d8415c4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@ Changelog
## vNext
+### Features
+
+- Implemented "Undelegate wallet" feature on "Wallet settings" screen ([PR 2351](https://github.com/input-output-hk/daedalus/pull/2351))
+
### Fixes
- Fixed calendar style issue on Filter dialog on transaction list screen ([PR 2387](https://github.com/input-output-hk/daedalus/pull/2387))
diff --git a/source/renderer/app/actions/wallets-actions.js b/source/renderer/app/actions/wallets-actions.js
index f31b5d9598..c50973ce8f 100644
--- a/source/renderer/app/actions/wallets-actions.js
+++ b/source/renderer/app/actions/wallets-actions.js
@@ -6,6 +6,7 @@ import type {
HardwareWalletExtendedPublicKeyResponse,
} from '../../../common/types/hardware-wallets.types';
import type { CsvFileContent } from '../../../common/types/csv-request.types';
+import type { QuitStakePoolRequest } from '../api/staking/types';
export type WalletImportFromFileParams = {
filePath: string,
@@ -44,11 +45,7 @@ export default class WalletsActions {
restoreWallet: Action = new Action();
importWalletFromFile: Action = new Action();
deleteWallet: Action<{ walletId: string, isLegacy: boolean }> = new Action();
- undelegateWallet: Action<{
- walletId: string,
- stakePoolId: string,
- passphrase: string,
- }> = new Action();
+ undelegateWallet: Action = new Action();
setUndelegateWalletSubmissionSuccess: Action<{
result: boolean,
}> = new Action();
diff --git a/source/renderer/app/api/api.js b/source/renderer/app/api/api.js
index 8eb19aa137..1e6e5fee93 100644
--- a/source/renderer/app/api/api.js
+++ b/source/renderer/app/api/api.js
@@ -108,6 +108,8 @@ import {
SMASH_SERVERS_LIST,
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE,
REWARDS_REDEMPTION_FEE_CALCULATION_AMOUNT,
+ DELEGATION_DEPOSIT,
+ DELEGATION_ACTIONS,
} from '../config/stakingConfig';
import {
ADA_CERTIFICATE_MNEMONIC_LENGTH,
@@ -998,19 +1000,30 @@ export default class AdaApi {
});
}
- const deposits = map(response.deposits, (deposit) => deposit.quantity);
- const totalDeposits = deposits.length
- ? BigNumber.sum.apply(null, deposits)
+ const depositsArray = map(
+ response.deposits,
+ (deposit) => deposit.quantity
+ );
+ const deposits = depositsArray.length
+ ? BigNumber.sum.apply(null, depositsArray)
: new BigNumber(0);
- const feeWithDeposits = totalInputs.minus(totalOutputs);
- const fee = feeWithDeposits.minus(totalDeposits);
+ // @TODO - Use api response when api is ready
+ const depositsReclaimed =
+ delegation && delegation.delegationAction === DELEGATION_ACTIONS.QUIT
+ ? new BigNumber(DELEGATION_DEPOSIT).multipliedBy(LOVELACES_PER_ADA)
+ : new BigNumber(0);
+ const fee =
+ delegation && delegation.delegationAction === DELEGATION_ACTIONS.QUIT
+ ? totalInputs.minus(totalOutputs).plus(depositsReclaimed)
+ : totalInputs.minus(totalOutputs).minus(deposits);
const extendedResponse = {
inputs: inputsData,
outputs: outputsData,
certificates: certificatesData,
- feeWithDeposits: feeWithDeposits.dividedBy(LOVELACES_PER_ADA),
fee: fee.dividedBy(LOVELACES_PER_ADA),
+ deposits: deposits.dividedBy(LOVELACES_PER_ADA),
+ depositsReclaimed: depositsReclaimed.dividedBy(LOVELACES_PER_ADA),
};
logger.debug('AdaApi::selectCoins success', { extendedResponse });
return extendedResponse;
@@ -2479,7 +2492,9 @@ const _createWalletFromServerData = action(
const next = get(delegation, 'next', null);
const lastPendingStakePool = next ? last(next) : null;
const lastTarget = get(lastPendingStakePool, 'target', null);
- const lastDelegationStakePoolId = isLegacy ? null : lastTarget;
+ const lastStatus = get(lastPendingStakePool, 'status', null);
+ const lastDelegatedStakePoolId = isLegacy ? null : lastTarget;
+ const lastDelegationStakePoolStatus = isLegacy ? null : lastStatus;
return new Wallet({
id,
@@ -2496,7 +2511,8 @@ const _createWalletFromServerData = action(
isHardwareWallet,
delegatedStakePoolId,
delegationStakePoolStatus,
- lastDelegationStakePoolId,
+ lastDelegatedStakePoolId,
+ lastDelegationStakePoolStatus,
pendingDelegations: next,
discovery,
});
@@ -2605,10 +2621,12 @@ const _createDelegationFeeFromServerData = action(
const fee = new BigNumber(
get(data, ['estimated_max', 'quantity'], 0)
).dividedBy(LOVELACES_PER_ADA);
- const deposit = new BigNumber(
+ const deposits = new BigNumber(
get(data, ['deposit', 'quantity'], 0)
).dividedBy(LOVELACES_PER_ADA);
- return { fee, deposit };
+ // @TODO Use api response data when api is ready
+ const depositsReclaimed = new BigNumber(0);
+ return { fee, deposits, depositsReclaimed };
}
);
diff --git a/source/renderer/app/api/staking/types.js b/source/renderer/app/api/staking/types.js
index 380d1d1858..6eba284f7d 100644
--- a/source/renderer/app/api/staking/types.js
+++ b/source/renderer/app/api/staking/types.js
@@ -96,12 +96,14 @@ export type GetDelegationFeeRequest = {
export type DelegationCalculateFeeResponse = {
fee: BigNumber,
- deposit: BigNumber,
+ deposits: BigNumber,
+ depositsReclaimed: BigNumber,
};
export type QuitStakePoolRequest = {
walletId: string,
passphrase: string,
+ isHardwareWallet?: boolean,
};
export type GetRedeemItnRewardsFeeRequest = {
diff --git a/source/renderer/app/api/transactions/types.js b/source/renderer/app/api/transactions/types.js
index d161ae0f8e..dd8ef8ae67 100644
--- a/source/renderer/app/api/transactions/types.js
+++ b/source/renderer/app/api/transactions/types.js
@@ -223,7 +223,8 @@ export type CoinSelectionsResponse = {
inputs: Array,
outputs: Array,
certificates: CoinSelectionCertificates,
- feeWithDeposits: BigNumber,
+ deposits: BigNumber,
+ depositsReclaimed: BigNumber,
fee: BigNumber,
};
diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.js b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.js
index dc1682bccb..154ed3de91 100644
--- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.js
+++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.js
@@ -190,7 +190,7 @@ export default class DelegationStepsChooseStakePoolDialog extends Component<
);
const lastDelegatedStakePoolId = get(
selectedWallet,
- 'lastDelegationStakePoolId',
+ 'lastDelegatedStakePoolId',
null
);
const delegatedStakePoolId = get(
diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.js b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.js
index d5714b46d2..71b13baace 100644
--- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.js
+++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.js
@@ -305,15 +305,16 @@ export default class DelegationStepsConfirmationDialog extends Component
{formattedWalletAmount(transactionFee.fee, false)}
- {intl.formatMessage(globalMessages.unitAda)}
+ {` `}
+ {intl.formatMessage(globalMessages.unitAda)}
>
)}
{transactionFee &&
- transactionFee.deposit.isZero &&
- !transactionFee.deposit.isZero() && (
+ transactionFee.deposits.isZero &&
+ !transactionFee.deposits.isZero() && (
<>
@@ -321,10 +322,11 @@ export default class DelegationStepsConfirmationDialog extends Component
- {formattedWalletAmount(transactionFee.deposit, false)}
+ {formattedWalletAmount(transactionFee.deposits, false)}
- {intl.formatMessage(globalMessages.unitAda)}
+ {` `}
+ {intl.formatMessage(globalMessages.unitAda)}
diff --git a/source/renderer/app/components/wallet/settings/DelegateWalletButton.js b/source/renderer/app/components/wallet/settings/DelegateWalletButton.js
new file mode 100644
index 0000000000..8fd9fa3cb0
--- /dev/null
+++ b/source/renderer/app/components/wallet/settings/DelegateWalletButton.js
@@ -0,0 +1,37 @@
+// @flow
+import React, { Component } from 'react';
+import { defineMessages, intlShape } from 'react-intl';
+import { Button } from 'react-polymorph/lib/components/Button';
+import styles from './DelegateWalletButton.scss';
+
+const messages = defineMessages({
+ label: {
+ id: 'wallet.settings.delegateWalletButtonLabel',
+ defaultMessage: '!!!Delegate',
+ description: 'Label for the delegate button on wallet settings',
+ },
+});
+
+type Props = {
+ disabled?: boolean,
+ onDelegate: Function,
+};
+
+export default class DelegateWalletButton extends Component {
+ static contextTypes = {
+ intl: intlShape.isRequired,
+ };
+
+ render() {
+ const { disabled, onDelegate } = this.props;
+ const label = this.context.intl.formatMessage(messages.label);
+ return (
+
+ );
+ }
+}
diff --git a/source/renderer/app/components/wallet/settings/DelegateWalletButton.scss b/source/renderer/app/components/wallet/settings/DelegateWalletButton.scss
new file mode 100644
index 0000000000..1e98dc4606
--- /dev/null
+++ b/source/renderer/app/components/wallet/settings/DelegateWalletButton.scss
@@ -0,0 +1,8 @@
+.root {
+ font-weight: 500;
+ height: 36px;
+ line-height: 36px;
+ margin-left: 20px;
+ min-width: 160px;
+ width: 160px;
+}
diff --git a/source/renderer/app/components/wallet/settings/UndelegateWalletButton.js b/source/renderer/app/components/wallet/settings/UndelegateWalletButton.js
new file mode 100644
index 0000000000..065abb6b17
--- /dev/null
+++ b/source/renderer/app/components/wallet/settings/UndelegateWalletButton.js
@@ -0,0 +1,38 @@
+// @flow
+import React, { Component } from 'react';
+import { defineMessages, intlShape } from 'react-intl';
+import { Button } from 'react-polymorph/lib/components/Button';
+import styles from './UndelegateWalletButton.scss';
+
+const messages = defineMessages({
+ label: {
+ id: 'wallet.settings.undelegateWalletButtonLabel',
+ defaultMessage: '!!!Undelegate',
+ description: 'Label for the undelegate button on wallet settings',
+ },
+});
+
+type Props = {
+ disabled?: boolean,
+ onUndelegate: Function,
+};
+
+export default class UndelegateWalletButton extends Component {
+ static contextTypes = {
+ intl: intlShape.isRequired,
+ };
+
+ render() {
+ const { disabled, onUndelegate } = this.props;
+ const label = this.context.intl.formatMessage(messages.label);
+ return (
+
+ );
+ }
+}
diff --git a/source/renderer/app/components/wallet/settings/UndelegateWalletButton.scss b/source/renderer/app/components/wallet/settings/UndelegateWalletButton.scss
new file mode 100644
index 0000000000..1e98dc4606
--- /dev/null
+++ b/source/renderer/app/components/wallet/settings/UndelegateWalletButton.scss
@@ -0,0 +1,8 @@
+.root {
+ font-weight: 500;
+ height: 36px;
+ line-height: 36px;
+ margin-left: 20px;
+ min-width: 160px;
+ width: 160px;
+}
diff --git a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js b/source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js
similarity index 55%
rename from source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js
rename to source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js
index d6c6fa64c4..663f999306 100644
--- a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js
+++ b/source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js
@@ -3,101 +3,109 @@
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { get } from 'lodash';
-import BigNumber from 'bignumber.js';
import { defineMessages, intlShape, FormattedHTMLMessage } from 'react-intl';
import vjf from 'mobx-react-form/lib/validators/VJF';
import classnames from 'classnames';
import { Checkbox } from 'react-polymorph/lib/components/Checkbox';
import { Input } from 'react-polymorph/lib/components/Input';
-import { CheckboxSkin } from 'react-polymorph/lib/skins/simple/CheckboxSkin';
-import { InputSkin } from 'react-polymorph/lib/skins/simple/InputSkin';
import ReactToolboxMobxForm from '../../../utils/ReactToolboxMobxForm';
import { FORM_VALIDATION_DEBOUNCE_WAIT } from '../../../config/timingConfig';
import { formattedWalletAmount } from '../../../utils/formatters';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import { FormattedHTMLMessageWithLink } from '../../widgets/FormattedHTMLMessageWithLink';
import Dialog from '../../widgets/Dialog';
+import Wallet, { HwDeviceStatuses } from '../../../domains/Wallet';
+import HardwareWalletStatus from '../../hardware-wallet/HardwareWalletStatus';
+import type { DelegationCalculateFeeResponse } from '../../../api/staking/types';
+import type { HwDeviceStatus } from '../../../domains/Wallet';
+import styles from './UndelegateWalletConfirmationDialog.scss';
import globalMessages from '../../../i18n/global-messages';
import LocalizableError from '../../../i18n/LocalizableError';
import { submitOnEnter } from '../../../utils/form';
-import styles from './UndelegateConfirmationDialog.scss';
const messages = defineMessages({
- dialogTitle: {
- id: 'staking.delegationCenter.undelegate.dialog.title',
+ title: {
+ id: 'wallet.settings.undelegate.dialog.title',
defaultMessage: '!!!Undelegate',
- description: 'Title for the "Undelegate" dialog.',
+ description: 'Title for the "Undelegate wallet" dialog.',
},
confirmButtonLabel: {
- id: 'staking.delegationCenter.undelegate.dialog.confirmButtonLabel',
+ id: 'wallet.settings.undelegate.dialog.confirmButtonLabel',
defaultMessage: '!!!Undelegate',
description:
- 'Label for the "Undelegate" button in the "Undelegate" dialog.',
+ 'Label for the "Undelegate" button in the undelegate wallet dialog.',
},
descriptionWithTicker: {
- id: 'staking.delegationCenter.undelegate.dialog.descriptionWithTicker',
+ id: 'wallet.settings.undelegate.dialog.descriptionWithTicker',
defaultMessage:
'!!!The stake from your wallet {walletName} is currently delegated to the [{stakePoolTicker}] {stakePoolName} stake pool.
Do you want to undelegate your stake and stop earning rewards?
',
- description: 'Description for the "Undelegate" dialog.',
+ description:
+ 'Description of current delegation of wallet in the "Undelegate wallet" dialog.',
},
descriptionWithUnknownTicker: {
- id:
- 'staking.delegationCenter.undelegate.dialog.descriptionWithUnknownTicker',
+ id: 'wallet.settings.undelegate.dialog.descriptionWithUnknownTicker',
defaultMessage:
'!!!The stake from your wallet {walletName} is currently delegated to the {stakePoolTicker} stake pool.
Do you want to undelegate your stake and stop earning rewards?
',
- description: 'Description for the "Undelegate" dialog.',
+ description:
+ 'Description of current delegation of wallet in the "Undelegate wallet" dialog.',
+ },
+ unknownStakePoolLabel: {
+ id: 'wallet.settings.undelegate.dialog.unknownStakePoolLabel',
+ defaultMessage: '!!!unknown',
+ description: 'unknown stake pool label in the "Undelegate wallet" dialog.',
},
- confirmUnsupportCheck: {
- id: 'staking.delegationCenter.undelegate.dialog.confirmUnsupportCheck',
+ confirmUnsupportNotice: {
+ id: 'wallet.settings.undelegate.dialog.confirmUnsupportNotice',
defaultMessage:
'!!!I understand that I am not supporting the Cardano network when my stake is undelegated.',
description:
- 'Label for the unsupport confirmation check in the "Undelegate" dialog.',
+ 'Notice to confirm if the user understands unsupporting Cardano network after undelegation',
},
- confirmIneligibleCheck: {
- id: 'staking.delegationCenter.undelegate.dialog.confirmIneligibleCheck',
+ confirmIneligibleNotice: {
+ id: 'wallet.settings.undelegate.dialog.confirmIneligibleNotice',
defaultMessage:
'!!!I understand that I will not be eligible to earn rewards when my stake is undelegated.',
description:
- 'Label for the ineligible confirmation check in the "Undelegate" dialog.',
+ 'Notice to confirm if the user understands non-earning rewards after undelegation',
},
feesLabel: {
- id: 'staking.delegationCenter.undelegate.dialog.feesLabel',
+ id: 'wallet.settings.undelegate.dialog.feesLabel',
defaultMessage: '!!!Fees',
- description: 'Fees label in the "Undelegate" dialog.',
+ description: 'Fees label in the "Undelegate wallet" dialog.',
+ },
+ depositLabel: {
+ id: 'wallet.settings.undelegate.dialog.depositLabel',
+ defaultMessage: '!!!Deposits reclaimed',
+ description: 'Deposits reclaimed label in the "Undelegate wallet" dialog.',
},
spendingPasswordLabel: {
- id: 'staking.delegationCenter.undelegate.dialog.spendingPasswordLabel',
+ id: 'wallet.settings.undelegate.dialog.spendingPasswordLabel',
defaultMessage: '!!!Spending password',
- description: 'Spending password label in the "Undelegate" dialog.',
+ description: 'Spending password label in the "Undelegate wallet" dialog.',
},
spendingPasswordPlaceholder: {
- id:
- 'staking.delegationCenter.undelegate.dialog.spendingPasswordPlaceholder',
+ id: 'wallet.settings.undelegate.dialog.spendingPasswordPlaceholder',
defaultMessage: '!!!Type your spending password here',
- description: 'Spending password placeholder in the "Undelegate" dialog.',
+ description:
+ 'Spending password placeholder in the "Undelegate wallet" dialog.',
},
passwordErrorMessage: {
- id: 'staking.delegationCenter.undelegate.dialog.passwordError',
+ id: 'wallet.settings.undelegate.dialog.passwordError',
defaultMessage: '!!!Incorrect spending password.',
- description: 'Label for password error in the "Undelegate" dialog.',
- },
- unknownStakePoolLabel: {
- id: 'staking.delegationCenter.undelegate.dialog.unknownStakePoolLabel',
- defaultMessage: '!!!unknown',
- description: 'unknown stake pool label in the "Undelegate" dialog.',
+ description: 'Label for password error in the "Undelegate wallet" dialog.',
},
calculatingFees: {
- id: 'staking.delegationCenter.undelegate.dialog.calculatingFees',
+ id: 'wallet.settings.undelegate.dialog.calculatingFees',
defaultMessage: '!!!Calculating fees',
- description: '"Calculating fees" message in the "Undelegate" dialog.',
+ description:
+ '"Calculating fees" message in the "Undelegate wallet" dialog.',
},
});
messages.fieldIsRequired = globalMessages.fieldIsRequired;
type Props = {
- walletName: string,
+ selectedWallet: ?Wallet,
stakePoolName: ?string,
stakePoolTicker: ?string,
onConfirm: Function,
@@ -105,11 +113,12 @@ type Props = {
onExternalLinkClick: Function,
isSubmitting: boolean,
error: ?LocalizableError,
- fees: ?BigNumber,
+ fees: ?DelegationCalculateFeeResponse,
+ hwDeviceStatus: HwDeviceStatus,
};
@observer
-export default class UndelegateConfirmationDialog extends Component {
+export default class UndelegateWalletConfirmationDialog extends Component {
static contextTypes = {
intl: intlShape.isRequired,
};
@@ -117,10 +126,10 @@ export default class UndelegateConfirmationDialog extends Component {
form = new ReactToolboxMobxForm(
{
fields: {
- isConfirmUnsupportChecked: {
+ confirmUnsupportChecked: {
type: 'checkbox',
label: this.context.intl.formatMessage(
- messages.confirmUnsupportCheck
+ messages.confirmUnsupportNotice
),
value: false,
validators: [
@@ -135,10 +144,10 @@ export default class UndelegateConfirmationDialog extends Component {
},
],
},
- isConfirmIneligibleChecked: {
+ confirmIneligibleChecked: {
type: 'checkbox',
label: this.context.intl.formatMessage(
- messages.confirmIneligibleCheck
+ messages.confirmIneligibleNotice
),
value: false,
validators: [
@@ -164,6 +173,11 @@ export default class UndelegateConfirmationDialog extends Component {
value: '',
validators: [
({ field }) => {
+ const isHardwareWallet = get(
+ this.props.selectedWallet,
+ 'isHardwareWallet'
+ );
+ if (isHardwareWallet) return [true];
if (field.value === '') {
return [
false,
@@ -185,16 +199,23 @@ export default class UndelegateConfirmationDialog extends Component {
}
);
- isConfirmDisabled = () => {
+ confirmationDisabled = () => {
const { form } = this;
- const { fees, isSubmitting } = this.props;
+ const { fees, isSubmitting, hwDeviceStatus, selectedWallet } = this.props;
const { isValid: unsupportCheckboxIsValid } = form.$(
- 'isConfirmUnsupportChecked'
+ 'confirmUnsupportChecked'
);
const { isValid: ineligibleCheckboxIsValid } = form.$(
- 'isConfirmIneligibleChecked'
+ 'confirmIneligibleChecked'
);
const { isValid: passphraseIsValid } = form.$('passphrase');
+ const isHardwareWallet = get(selectedWallet, 'isHardwareWallet');
+
+ if (isHardwareWallet) {
+ return (
+ hwDeviceStatus !== HwDeviceStatuses.VERIFYING_TRANSACTION_SUCCEEDED
+ );
+ }
return (
isSubmitting ||
@@ -206,15 +227,16 @@ export default class UndelegateConfirmationDialog extends Component {
};
handleSubmit = () => {
- if (this.isConfirmDisabled()) {
+ if (this.confirmationDisabled()) {
return false;
}
return this.form.submit({
onSuccess: (form) => {
- const { onConfirm } = this.props;
+ const { selectedWallet, onConfirm } = this.props;
+ const isHardwareWallet = get(selectedWallet, 'isHardwareWallet');
const { passphrase } = form.values();
- onConfirm(passphrase);
+ onConfirm(passphrase, isHardwareWallet);
},
onError: () => null,
});
@@ -246,18 +268,22 @@ export default class UndelegateConfirmationDialog extends Component {
render() {
const { form } = this;
const { intl } = this.context;
- const unsupportCheckboxField = form.$('isConfirmUnsupportChecked');
- const ineligibleCheckboxField = form.$('isConfirmIneligibleChecked');
+ const unsupportCheckboxField = form.$('confirmUnsupportChecked');
+ const ineligibleCheckboxField = form.$('confirmIneligibleChecked');
const passphraseField = form.$('passphrase');
const {
- walletName,
+ selectedWallet,
stakePoolName,
stakePoolTicker,
onCancel,
isSubmitting,
fees,
+ hwDeviceStatus,
+ onExternalLinkClick,
} = this.props;
- const isConfirmDisabled = this.isConfirmDisabled();
+ const walletName = get(selectedWallet, 'name');
+ const isHardwareWallet = get(selectedWallet, 'isHardwareWallet');
+ const confirmationDisabled = this.confirmationDisabled();
const buttonClasses = classnames([
'attention',
isSubmitting ? styles.isSubmitting : null,
@@ -271,7 +297,7 @@ export default class UndelegateConfirmationDialog extends Component {
className: buttonClasses,
label: intl.formatMessage(messages.confirmButtonLabel),
onClick: this.handleSubmit,
- disabled: isConfirmDisabled,
+ disabled: confirmationDisabled,
primary: true,
},
];
@@ -279,12 +305,14 @@ export default class UndelegateConfirmationDialog extends Component {
return (
null}
className={styles.dialog}
- closeButton={ }
+ closeButton={
+ null} />
+ }
>
{stakePoolTicker ? (
@@ -307,40 +335,68 @@ export default class UndelegateConfirmationDialog extends Component
{
-
-
- {intl.formatMessage(messages.feesLabel)}
-
-
- {!fees ? (
-
- {intl.formatMessage(messages.calculatingFees)}
-
- ) : (
- <>
- {formattedWalletAmount(fees, false)}
-
- {intl.formatMessage(globalMessages.unitAda)}
+
+
+
+ {intl.formatMessage(messages.feesLabel)}
+
+
+ {!fees || !fees.fee ? (
+
+ {intl.formatMessage(messages.calculatingFees)}
- >
- )}
-
+ ) : (
+ <>
+
{formattedWalletAmount(fees.fee, false)}
+
+ {` `}
+ {intl.formatMessage(globalMessages.unitAda)}
+
+ >
+ )}
+
+
+ {fees && !fees.depositsReclaimed.isZero() && (
+ <>
+
+
+ {intl.formatMessage(messages.depositLabel)}
+
+
+
+ {formattedWalletAmount(fees.depositsReclaimed, false)}
+
+
+ {` `}
+ {intl.formatMessage(globalMessages.unitAda)}
+
+
+
+ >
+ )}
-
+ {isHardwareWallet ? (
+
+
+
+ ) : (
+
+ )}
{errorElement && {errorElement}
}
);
diff --git a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.scss b/source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.scss
similarity index 60%
rename from source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.scss
rename to source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.scss
index e998e31400..234aefa8ac 100644
--- a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.scss
+++ b/source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.scss
@@ -29,31 +29,61 @@
.divider {
border-top: 1px solid
- var(--theme-staking-delegation-center-divider-border-color);
+ var(--theme-settings-undelegate-wallet-divider-border-color);
height: 1px;
margin: 20px 0;
width: 100%;
}
- .feesWrapper {
+ .feesRow {
+ align-items: center;
+ display: flex;
font-family: var(--font-medium);
font-weight: 500;
+ justify-content: space-between;
line-height: 1.38;
margin-bottom: 20px;
- .calculatingFeesLabel {
+ .feesWrapper,
+ .depositWrapper {
+ flex: 1;
+ }
+
+ .feesLabel,
+ .depositLabel {
+ color: var(--theme-delegation-steps-confirmation-fees-label-color);
+ margin-bottom: 6px;
+ }
+
+ .calculatingFeesLabel,
+ .calculatingDepositLabel {
@include animated-ellipsis($duration: 1500, $width: 20px);
--webkit-backface-visibility: hidden;
}
- .feesAmount {
- color: var(--theme-staking-delegation-center-fees-amount-color);
+ .feesAmount,
+ .depositAmount {
user-select: text;
- .feesAmountLabel {
+ .feesAmountLabel,
+ .depositAmountLabel {
font-family: var(--font-light);
}
}
+
+ .feesAmount {
+ color: var(--theme-settings-undelegate-wallet-fees-amount-color);
+ }
+
+ .depositAmount {
+ color: var(--theme-settings-undelegate-wallet-deposit-amount-color);
+ }
+ }
+
+ .hardwareWalletStatusWrapper {
+ margin-top: 20px;
+ max-width: 640px;
+ width: 100%;
}
.error {
diff --git a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js b/source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js
similarity index 87%
rename from source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js
rename to source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js
index acb02ddd1d..d184558d4e 100644
--- a/source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js
+++ b/source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js
@@ -5,26 +5,26 @@ import { defineMessages, intlShape, FormattedHTMLMessage } from 'react-intl';
import SVGInline from 'react-svg-inline';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import Dialog from '../../widgets/Dialog';
-import styles from './UndelegateConfirmationResultDialog.scss';
+import styles from './UndelegateWalletSuccessDialog.scss';
import globalMessages from '../../../i18n/global-messages';
import sadLogo from '../../../assets/images/untada.inline.svg';
import humanizeDurationByLocale from '../../../utils/humanizeDurationByLocale';
import { EPOCH_COUNTDOWN_INTERVAL } from '../../../config/stakingConfig';
const messages = defineMessages({
- dialogTitle: {
- id: 'staking.delegationCenter.undelegate.result.dialog.title',
+ title: {
+ id: 'wallet.settings.undelegate.result.dialog.title',
defaultMessage: '!!!Wallet undelegated',
description: 'Title for the "Undelegate Result" dialog.',
},
description1: {
- id: 'staking.delegationCenter.undelegate.result.dialog.description1',
+ id: 'wallet.settings.undelegate.result.dialog.description1',
defaultMessage:
'!!!The stake from your wallet {walletName} is no longer delegated and you will soon stop earning rewards for this wallet.',
description: 'Description 1 for the "Undelegate Result" dialog.',
},
description2: {
- id: 'staking.delegationCenter.undelegate.result.dialog.description2',
+ id: 'wallet.settings.undelegate.result.dialog.description2',
defaultMessage:
'!!!Your new delegation preferences are now posted on the blockchain and will take effect after both the current and next Cardano epochs have completed in {timeUntilNextEpochStart} . During this time, your previous delegation preferences are still active.',
description: 'Description 2 for the "Undelegate Result" dialog.',
@@ -40,7 +40,7 @@ type Props = {
type State = { timeUntilNextEpochStart: number };
@observer
-export default class UndelegateConfirmationResultDialog extends Component<
+export default class UndelegateWalletSuccessDialog extends Component<
Props,
State
> {
@@ -52,16 +52,12 @@ export default class UndelegateConfirmationResultDialog extends Component<
};
componentDidMount() {
- this.configureUpdateTimer();
- }
-
- configureUpdateTimer = () => {
this.updateTimeUntilNextEpochStart();
this.intervalHandler = setInterval(
() => this.updateTimeUntilNextEpochStart(),
EPOCH_COUNTDOWN_INTERVAL
);
- };
+ }
updateTimeUntilNextEpochStart = () => {
const { futureEpochStartTime } = this.props;
@@ -96,7 +92,7 @@ export default class UndelegateConfirmationResultDialog extends Component<
return (
{
walletPublicKeyQRCodeDialogContainer,
} = this.props;
- if (!WALLET_PUBLIC_KEY_SHARING_ENABLED) {
+ if (!IS_WALLET_PUBLIC_KEY_SHARING_ENABLED) {
return null;
}
@@ -172,6 +224,87 @@ export default class WalletSettings extends Component {
);
};
+ onUndelegateWalletClick = async () => {
+ const {
+ walletId,
+ openDialogAction,
+ updateDataForActiveDialogAction,
+ } = this.props;
+ this.onBlockForm();
+ openDialogAction({
+ dialog: UndelegateWalletConfirmationDialog,
+ });
+ updateDataForActiveDialogAction({
+ data: { walletId },
+ });
+ };
+
+ renderUndelegateWalletBox = () => {
+ const { intl } = this.context;
+ const {
+ delegationStakePoolStatus,
+ lastDelegationStakePoolStatus,
+ isRestoring,
+ isSyncing,
+ isLegacy,
+ isDialogOpen,
+ onDelegateClick,
+ undelegateWalletDialogContainer,
+ } = this.props;
+ const isDelegating = lastDelegationStakePoolStatus
+ ? lastDelegationStakePoolStatus === WalletDelegationStatuses.DELEGATING
+ : delegationStakePoolStatus === WalletDelegationStatuses.DELEGATING;
+
+ /// @TODO: Once undelegation for rewarded wallet works fine with api, remove reward checking and config
+ if (!IS_WALLET_UNDELEGATION_ENABLED || isLegacy) {
+ return null;
+ }
+
+ let headerMessage = null;
+ let warningMessage = null;
+
+ if (isDelegating) {
+ headerMessage = intl.formatMessage(messages.undelegateWalletHeader);
+ warningMessage =
+ isRestoring || isSyncing
+ ? intl.formatMessage(messages.undelegateWalletDisabledWarning)
+ : intl.formatMessage(messages.undelegateWalletWarning);
+ } else {
+ headerMessage = intl.formatMessage(messages.delegateWalletHeader);
+ warningMessage =
+ isRestoring || isSyncing
+ ? intl.formatMessage(messages.delegateWalletDisabledWarning)
+ : intl.formatMessage(messages.delegateWalletWarning);
+ }
+
+ return (
+ <>
+
+ {headerMessage}
+
+
+ {isDelegating ? (
+
+ ) : (
+
+ )}
+
+
+ {isDialogOpen(UndelegateWalletConfirmationDialog)
+ ? undelegateWalletDialogContainer
+ : false}
+ >
+ );
+ };
+
renderDeleteWalletBox = () => {
const { intl } = this.context;
const {
@@ -313,6 +446,7 @@ export default class WalletSettings extends Component {
: false}
{this.renderWalletPublicKeyBox()}
+ {this.renderUndelegateWalletBox()}
{this.renderDeleteWalletBox()}
);
diff --git a/source/renderer/app/components/wallet/settings/WalletSettings.scss b/source/renderer/app/components/wallet/settings/WalletSettings.scss
index 11a2bf7564..f66c2a28f0 100644
--- a/source/renderer/app/components/wallet/settings/WalletSettings.scss
+++ b/source/renderer/app/components/wallet/settings/WalletSettings.scss
@@ -24,8 +24,8 @@
margin-top: 20px;
}
+ .undelegateWalletBox,
.deleteWalletBox {
- margin-bottom: 20px;
margin-top: 20px;
span {
@@ -48,8 +48,23 @@
p:first-child {
margin-bottom: 15px;
}
+ p:last-child {
+ margin-bottom: 0;
+ }
+ }
+ }
+
+ .undelegateWalletBox {
+ :global {
+ .SimpleButton_root.flat {
+ color: var(--theme-color-error);
+ }
}
}
+
+ .deleteWalletBox {
+ margin-bottom: 20px;
+ }
}
.error {
diff --git a/source/renderer/app/components/widgets/forms/WalletsDropdown.js b/source/renderer/app/components/widgets/forms/WalletsDropdown.js
index 4bf0537f19..5e33a88e2d 100644
--- a/source/renderer/app/components/widgets/forms/WalletsDropdown.js
+++ b/source/renderer/app/components/widgets/forms/WalletsDropdown.js
@@ -114,7 +114,7 @@ export default class WalletsDropdown extends Component {
id: value,
amount,
delegatedStakePoolId,
- lastDelegationStakePoolId,
+ lastDelegatedStakePoolId,
pendingDelegations,
isRestoring,
isHardwareWallet,
@@ -123,7 +123,7 @@ export default class WalletsDropdown extends Component {
pendingDelegations && pendingDelegations.length > 0;
let currentStakePoolId = delegatedStakePoolId;
if (hasPendingDelegations) {
- currentStakePoolId = lastDelegationStakePoolId;
+ currentStakePoolId = lastDelegatedStakePoolId;
}
const delegatedStakePool = getStakePoolById(currentStakePoolId);
const detail = !isRestoring ? formattedWalletAmount(amount) : null;
diff --git a/source/renderer/app/config/stakingConfig.js b/source/renderer/app/config/stakingConfig.js
index c04b2ad06f..cbe1e0aaf3 100644
--- a/source/renderer/app/config/stakingConfig.js
+++ b/source/renderer/app/config/stakingConfig.js
@@ -104,6 +104,8 @@ export const REDEEM_ITN_REWARDS_STEPS: {
RESULT: 'result',
};
+export const DELEGATION_DEPOSIT = 2; // 2 ADA | unit: lovelace
+
export const DELEGATION_ACTIONS: {
[key: string]: DelegationAction,
} = {
diff --git a/source/renderer/app/config/walletsConfig.js b/source/renderer/app/config/walletsConfig.js
index 5291f1eb17..fad5a808ce 100644
--- a/source/renderer/app/config/walletsConfig.js
+++ b/source/renderer/app/config/walletsConfig.js
@@ -32,10 +32,12 @@ export const RECOVERY_PHRASE_WORD_COUNT_OPTIONS = {
};
export const WALLET_PUBLIC_KEY_NOTIFICATION_SEGMENT_LENGTH = 15;
-export const WALLET_PUBLIC_KEY_SHARING_ENABLED = false;
+export const IS_WALLET_PUBLIC_KEY_SHARING_ENABLED = false;
// Automatic wallet migration from pre Daedalus 1.0.0 versions has been disabled
export const IS_AUTOMATIC_WALLET_MIGRATION_ENABLED = false;
// Byron wallet migration has been temporarily disabled due to missing Api support after Mary HF
export const IS_BYRON_WALLET_MIGRATION_ENABLED = false;
+
+export const IS_WALLET_UNDELEGATION_ENABLED = false;
diff --git a/source/renderer/app/containers/staking/DelegationCenterPage.js b/source/renderer/app/containers/staking/DelegationCenterPage.js
index bd3c30837d..0fa329bbaa 100644
--- a/source/renderer/app/containers/staking/DelegationCenterPage.js
+++ b/source/renderer/app/containers/staking/DelegationCenterPage.js
@@ -3,8 +3,8 @@ import React, { Component, Fragment } from 'react';
import { observer, inject } from 'mobx-react';
import DelegationCenter from '../../components/staking/delegation-center/DelegationCenter';
import DelegationSetupWizardDialogContainer from './dialogs/DelegationSetupWizardDialogContainer';
-import UndelegateDialogContainer from './dialogs/UndelegateDialogContainer';
-import UndelegateConfirmationDialog from '../../components/staking/delegation-center/UndelegateConfirmationDialog';
+import UndelegateWalletDialogContainer from '../wallet/dialogs/settings/UndelegateWalletDialogContainer';
+import UndelegateWalletConfirmationDialog from '../../components/wallet/settings/UndelegateWalletConfirmationDialog';
import DelegationSetupWizardDialog from '../../components/staking/delegation-setup-wizard/DelegationSetupWizardDialog';
import DelegationCenterNoWallets from '../../components/staking/delegation-center/DelegationCenterNoWallets';
import { ROUTES } from '../../routes-config';
@@ -47,31 +47,14 @@ export default class DelegationCenterPage extends Component {
};
handleUndelegate = async (walletId: string) => {
- const { actions, stores } = this.props;
- const { updateDataForActiveDialog } = actions.dialogs;
- const { isOpen } = stores.uiDialogs;
- const { calculateDelegationFee } = stores.staking;
-
- actions.dialogs.open.trigger({ dialog: UndelegateConfirmationDialog });
- const dialogData = {
- walletId,
- stakePoolQuitFee: null,
- };
- updateDataForActiveDialog.trigger({ data: dialogData });
-
- // Update dialog one more time when quit fee is calculated
- const stakePoolQuitFee = await calculateDelegationFee({ walletId });
-
- // Update dialog data only if UndelegateConfirmationDialog is still active
- // and fee calculation was successful
- if (isOpen(UndelegateConfirmationDialog) && stakePoolQuitFee) {
- updateDataForActiveDialog.trigger({
- data: {
- ...dialogData,
- stakePoolQuitFee,
- },
- });
- }
+ const { dialogs } = this.props.actions;
+
+ dialogs.open.trigger({
+ dialog: UndelegateWalletConfirmationDialog,
+ });
+ dialogs.updateDataForActiveDialog.trigger({
+ data: { walletId },
+ });
};
handleGoToCreateWalletClick = () => {
@@ -137,8 +120,8 @@ export default class DelegationCenterPage extends Component {
containerClassName="StakingWithNavigation_page"
setListActive={this.handleSetListActive}
/>
- {uiDialogs.isOpen(UndelegateConfirmationDialog) ? (
-
) : null}
diff --git a/source/renderer/app/containers/staking/Staking.js b/source/renderer/app/containers/staking/Staking.js
index 5333271842..17937168d9 100644
--- a/source/renderer/app/containers/staking/Staking.js
+++ b/source/renderer/app/containers/staking/Staking.js
@@ -7,7 +7,7 @@ import StakingUnavailable from '../../components/staking/StakingUnavailable';
import StakingWithNavigation from '../../components/staking/layouts/StakingWithNavigation';
import ExperimentalDataOverlay from '../../components/notifications/ExperimentalDataOverlay';
import DelegationSetupWizardDialog from '../../components/staking/delegation-setup-wizard/DelegationSetupWizardDialog';
-import UndelegateConfirmationDialog from '../../components/staking/delegation-center/UndelegateConfirmationDialog';
+import UndelegateWalletConfirmationDialog from '../../components/wallet/settings/UndelegateWalletConfirmationDialog';
import { ROUTES } from '../../routes-config';
import { buildRoute } from '../../utils/routing';
import type { InjectedContainerProps } from '../../types/injectedPropsType';
@@ -91,7 +91,7 @@ export default class Staking extends Component {
);
const isUndelegationWizardOpen = uiDialogs.isOpen(
- UndelegateConfirmationDialog
+ UndelegateWalletConfirmationDialog
);
if (!isSynced && !(isDelegationWizardOpen || isUndelegationWizardOpen)) {
diff --git a/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.js b/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.js
index 8b7b6f6915..012bddf96d 100644
--- a/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.js
+++ b/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.js
@@ -261,11 +261,8 @@ export default class DelegationSetupWizardDialogContainer extends Component<
poolId,
delegationAction: DELEGATION_ACTIONS.JOIN,
});
- const { feeWithDeposits, fee } = coinsSelection;
- stakePoolJoinFee = {
- fee,
- deposit: feeWithDeposits.minus(fee),
- };
+ const { deposits, depositsReclaimed, fee } = coinsSelection;
+ stakePoolJoinFee = { deposits, depositsReclaimed, fee };
// Initiate Transaction (Delegation)
hardwareWallets.initiateTransaction({ walletId: selectedWalletId });
} else {
diff --git a/source/renderer/app/containers/staking/dialogs/UndelegateDialogContainer.js b/source/renderer/app/containers/staking/dialogs/UndelegateDialogContainer.js
deleted file mode 100644
index 842778c1d3..0000000000
--- a/source/renderer/app/containers/staking/dialogs/UndelegateDialogContainer.js
+++ /dev/null
@@ -1,101 +0,0 @@
-// @flow
-import React, { Component } from 'react';
-import { inject, observer } from 'mobx-react';
-import { get } from 'lodash';
-import type { StoresMap } from '../../../stores/index';
-import type { ActionsMap } from '../../../actions/index';
-import UndelegateConfirmationDialog from '../../../components/staking/delegation-center/UndelegateConfirmationDialog';
-import UndelegateConfirmationResultDialog from '../../../components/staking/delegation-center/UndelegateConfirmationResultDialog';
-
-type Props = {
- stores: any | StoresMap,
- actions: any | ActionsMap,
- onExternalLinkClick: Function,
-};
-
-@inject('actions', 'stores')
-@observer
-export default class UndelegateDialogContainer extends Component {
- static defaultProps = { actions: null, stores: null };
-
- render() {
- const { actions, stores, onExternalLinkClick } = this.props;
- const { uiDialogs, wallets, staking, networkStatus, profile } = stores;
- const dialogData = uiDialogs.dataForActiveDialog;
- const { walletId, stakePoolQuitFee } = dialogData;
- const { futureEpoch } = networkStatus;
- const { currentLocale } = profile;
- const {
- getStakePoolById,
- quitStakePoolRequest,
- isDelegationTransactionPending,
- } = staking;
- const { getWalletById, undelegateWalletSubmissionSuccess } = wallets;
- const futureEpochStartTime = get(futureEpoch, 'epochStart', 0);
-
- const walletToBeUndelegated = getWalletById(walletId);
- if (!walletToBeUndelegated) return null;
-
- const { name: walletName } = walletToBeUndelegated;
-
- const {
- lastDelegationStakePoolId,
- delegatedStakePoolId,
- } = walletToBeUndelegated;
-
- const stakePoolId = lastDelegationStakePoolId || delegatedStakePoolId || '';
-
- if (
- (!stakePoolId || !isDelegationTransactionPending) &&
- undelegateWalletSubmissionSuccess &&
- !quitStakePoolRequest.error
- ) {
- return (
- {
- actions.dialogs.closeActiveDialog.trigger();
- quitStakePoolRequest.reset();
- actions.wallets.setUndelegateWalletSubmissionSuccess.trigger({
- result: false,
- });
- }}
- />
- );
- }
-
- const delegatedStakePool = getStakePoolById(stakePoolId);
- const stakePoolName = get(delegatedStakePool, 'name', '');
- const stakePoolTicker = get(delegatedStakePool, 'ticker');
-
- return (
- {
- actions.wallets.undelegateWallet.trigger({
- walletId,
- stakePoolId,
- passphrase,
- });
- }}
- onCancel={() => {
- actions.dialogs.closeActiveDialog.trigger();
- quitStakePoolRequest.reset();
- actions.wallets.setUndelegateWalletSubmissionSuccess.trigger({
- result: false,
- });
- }}
- onExternalLinkClick={onExternalLinkClick}
- isSubmitting={
- quitStakePoolRequest.isExecuting || isDelegationTransactionPending
- }
- error={quitStakePoolRequest.error}
- fees={stakePoolQuitFee}
- />
- );
- }
-}
diff --git a/source/renderer/app/containers/wallet/WalletSettingsPage.js b/source/renderer/app/containers/wallet/WalletSettingsPage.js
index 6690ee6e68..dd5062046e 100644
--- a/source/renderer/app/containers/wallet/WalletSettingsPage.js
+++ b/source/renderer/app/containers/wallet/WalletSettingsPage.js
@@ -8,12 +8,14 @@ import { ellipsis } from '../../utils/strings';
import ChangeSpendingPasswordDialogContainer from './dialogs/settings/ChangeSpendingPasswordDialogContainer';
import WalletRecoveryPhraseContainer from './dialogs/settings/WalletRecoveryPhraseContainer';
import WalletPublicKeyQRCodeDialogContainer from './dialogs/settings/WalletPublicKeyQRCodeDialogContainer';
+import UndelegateWalletDialogContainer from './dialogs/settings/UndelegateWalletDialogContainer';
import DeleteWalletDialogContainer from './dialogs/settings/DeleteWalletDialogContainer';
import ExportWalletToFileDialogContainer from './dialogs/settings/ExportWalletToFileDialogContainer';
import {
LEGACY_WALLET_RECOVERY_PHRASE_WORD_COUNT,
WALLET_RECOVERY_PHRASE_WORD_COUNT,
} from '../../config/cryptoConfig';
+import { ROUTES } from '../../routes-config';
import { WALLET_PUBLIC_KEY_NOTIFICATION_SEGMENT_LENGTH } from '../../config/walletsConfig';
type Props = InjectedProps;
@@ -38,6 +40,11 @@ export default class WalletSettingsPage extends Component {
wallets._getWalletPublicKey();
};
+ handleDelegateClick = () => {
+ const { goToRoute } = this.props.actions.router;
+ goToRoute.trigger({ route: ROUTES.STAKING.DELEGATION_CENTER });
+ };
+
render() {
const {
uiDialogs,
@@ -109,6 +116,12 @@ export default class WalletSettingsPage extends Component {
isLegacy={isLegacy}
walletId={activeWallet.id}
walletName={activeWallet.name}
+ delegationStakePoolStatus={activeWallet.delegationStakePoolStatus}
+ lastDelegationStakePoolStatus={
+ activeWallet.lastDelegationStakePoolStatus
+ }
+ isRestoring={activeWallet.isRestoring}
+ isSyncing={activeWallet.isSyncing}
walletPublicKey={activeWalletPublicKey}
creationDate={creationDate}
isIncentivizedTestnet={isIncentivizedTestnet}
@@ -127,6 +140,10 @@ export default class WalletSettingsPage extends Component {
onCancel={cancelEditingWalletField.trigger}
onVerifyRecoveryPhrase={recoveryPhraseVerificationContinue.trigger}
onCopyWalletPublicKey={this.handleCopyWalletPublicKey}
+ updateDataForActiveDialogAction={
+ actions.dialogs.updateDataForActiveDialog.trigger
+ }
+ onDelegateClick={this.handleDelegateClick}
getWalletPublicKey={this.handleGetWalletPublicKey}
activeField={walletFieldBeingEdited}
nameValidator={(name) => isValidWalletName(name)}
@@ -136,6 +153,11 @@ export default class WalletSettingsPage extends Component {
walletPublicKeyQRCodeDialogContainer={
}
+ undelegateWalletDialogContainer={
+
+ }
deleteWalletDialogContainer={ }
exportWalletDialogContainer={ }
locale={locale}
diff --git a/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.js b/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.js
new file mode 100644
index 0000000000..4dff4d4bbf
--- /dev/null
+++ b/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.js
@@ -0,0 +1,189 @@
+// @flow
+import React, { Component } from 'react';
+import { inject, observer } from 'mobx-react';
+import { get, find } from 'lodash';
+import BigNumber from 'bignumber.js';
+import type { InjectedProps } from '../../../../types/injectedPropsType';
+import type { DelegationCalculateFeeResponse } from '../../../../api/staking/types';
+import UndelegateWalletConfirmationDialog from '../../../../components/wallet/settings/UndelegateWalletConfirmationDialog';
+import UndelegateWalletSuccessDialog from '../../../../components/wallet/settings/UndelegateWalletSuccessDialog';
+import {
+ DELEGATION_ACTIONS,
+ DELEGATION_DEPOSIT,
+} from '../../../../config/stakingConfig';
+
+type Props = {
+ ...InjectedProps,
+ onExternalLinkClick: Function,
+};
+
+type State = {
+ stakePoolQuitFee: ?DelegationCalculateFeeResponse,
+};
+
+@inject('actions', 'stores')
+@observer
+export default class UndelegateWalletDialogContainer extends Component<
+ Props,
+ State
+> {
+ static defaultProps = { actions: null, stores: null };
+
+ state = {
+ stakePoolQuitFee: null,
+ };
+
+ _isMounted = false;
+
+ componentDidMount() {
+ this._isMounted = true;
+
+ this._handleCalculateTransactionFee();
+ }
+
+ componentWillUnmount() {
+ this._isMounted = false;
+ }
+
+ get selectedWalletId() {
+ return get(
+ this.props,
+ ['stores', 'uiDialogs', 'dataForActiveDialog', 'walletId'],
+ null
+ );
+ }
+
+ async _handleCalculateTransactionFee() {
+ const { staking, wallets, hardwareWallets } = this.props.stores;
+ const { calculateDelegationFee } = staking;
+
+ const selectedWallet = find(
+ wallets.allWallets,
+ (wallet) => wallet.id === this.selectedWalletId
+ );
+ const { lastDelegatedStakePoolId, delegatedStakePoolId } = selectedWallet;
+ const poolId = lastDelegatedStakePoolId || delegatedStakePoolId || '';
+
+ let stakePoolQuitFee;
+ if (selectedWallet.isHardwareWallet) {
+ const coinsSelection = await hardwareWallets.selectDelegationCoins({
+ walletId: this.selectedWalletId,
+ poolId,
+ delegationAction: DELEGATION_ACTIONS.QUIT,
+ });
+ const { deposits, depositsReclaimed, fee } = coinsSelection;
+ stakePoolQuitFee = { deposits, depositsReclaimed, fee };
+ hardwareWallets.initiateTransaction({ walletId: this.selectedWalletId });
+ } else {
+ stakePoolQuitFee = await calculateDelegationFee({
+ walletId: this.selectedWalletId,
+ });
+ // @TODO Remove this when api returns depositsReclaimed value
+ if (stakePoolQuitFee) {
+ stakePoolQuitFee.depositsReclaimed = new BigNumber(DELEGATION_DEPOSIT);
+ }
+ }
+
+ if (this._isMounted && stakePoolQuitFee) {
+ this.setState({ stakePoolQuitFee });
+ }
+ }
+
+ render() {
+ const { actions, stores, onExternalLinkClick } = this.props;
+ const {
+ wallets,
+ staking,
+ networkStatus,
+ profile,
+ hardwareWallets,
+ } = stores;
+ const { futureEpoch } = networkStatus;
+ const { currentLocale } = profile;
+ const {
+ getStakePoolById,
+ quitStakePoolRequest,
+ isDelegationTransactionPending,
+ } = staking;
+ const { getWalletById, undelegateWalletSubmissionSuccess } = wallets;
+ const {
+ hwDeviceStatus,
+ sendMoneyRequest,
+ selectCoinsRequest,
+ } = hardwareWallets;
+ const { stakePoolQuitFee } = this.state;
+ const futureEpochStartTime = get(futureEpoch, 'epochStart', 0);
+
+ const walletToBeUndelegated = getWalletById(this.selectedWalletId);
+ if (!walletToBeUndelegated) return null;
+
+ const { name: walletName } = walletToBeUndelegated;
+
+ const {
+ lastDelegatedStakePoolId,
+ delegatedStakePoolId,
+ } = walletToBeUndelegated;
+
+ const stakePoolId = lastDelegatedStakePoolId || delegatedStakePoolId || '';
+
+ if (
+ (!stakePoolId || !isDelegationTransactionPending) &&
+ undelegateWalletSubmissionSuccess &&
+ !quitStakePoolRequest.error
+ ) {
+ return (
+ {
+ actions.dialogs.closeActiveDialog.trigger();
+ quitStakePoolRequest.reset();
+ actions.wallets.setUndelegateWalletSubmissionSuccess.trigger({
+ result: false,
+ });
+ }}
+ />
+ );
+ }
+
+ const delegatedStakePool = getStakePoolById(stakePoolId);
+ const stakePoolName = get(delegatedStakePool, 'name', '');
+ const stakePoolTicker = get(delegatedStakePool, 'ticker');
+
+ return (
+ {
+ actions.wallets.undelegateWallet.trigger({
+ walletId: this.selectedWalletId,
+ passphrase,
+ isHardwareWallet,
+ });
+ }}
+ onCancel={() => {
+ actions.dialogs.closeActiveDialog.trigger();
+ quitStakePoolRequest.reset();
+ actions.wallets.setUndelegateWalletSubmissionSuccess.trigger({
+ result: false,
+ });
+ }}
+ onExternalLinkClick={onExternalLinkClick}
+ isSubmitting={
+ quitStakePoolRequest.isExecuting ||
+ sendMoneyRequest.isExecuting ||
+ isDelegationTransactionPending
+ }
+ error={
+ quitStakePoolRequest.error ||
+ sendMoneyRequest.error ||
+ selectCoinsRequest.error
+ }
+ fees={stakePoolQuitFee}
+ hwDeviceStatus={hwDeviceStatus}
+ />
+ );
+ }
+}
diff --git a/source/renderer/app/domains/Wallet.js b/source/renderer/app/domains/Wallet.js
index 324de1e911..64cca353da 100644
--- a/source/renderer/app/domains/Wallet.js
+++ b/source/renderer/app/domains/Wallet.js
@@ -102,9 +102,11 @@ export type WalletProps = {
passwordUpdateDate: ?Date,
syncState: WalletSyncState,
isLegacy: boolean,
+ isHardwareWallet?: boolean,
delegatedStakePoolId?: ?string,
delegationStakePoolStatus?: ?string,
- lastDelegationStakePoolId?: ?string,
+ lastDelegatedStakePoolId?: ?string,
+ lastDelegationStakePoolStatus?: ?string,
pendingDelegations?: WalletPendingDelegations,
discovery: Discovery,
hasPassword: boolean,
@@ -123,7 +125,8 @@ export default class Wallet {
@observable isLegacy: boolean;
@observable delegatedStakePoolId: ?string;
@observable delegationStakePoolStatus: ?string;
- @observable lastDelegationStakePoolId: ?string;
+ @observable lastDelegatedStakePoolId: ?string;
+ @observable lastDelegationStakePoolStatus: ?string;
@observable pendingDelegations: WalletPendingDelegations;
@observable discovery: Discovery;
@observable hasPassword: boolean;
@@ -149,7 +152,8 @@ export default class Wallet {
'isLegacy',
'delegatedStakePoolId',
'delegationStakePoolStatus',
- 'lastDelegationStakePoolId',
+ 'lastDelegatedStakePoolId',
+ 'lastDelegationStakePoolStatus',
'pendingDelegations',
'discovery',
'hasPassword',
@@ -170,6 +174,10 @@ export default class Wallet {
);
}
+ @computed get isSyncing(): boolean {
+ return get(this, 'syncState.status') === WalletSyncStateStatuses.SYNCING;
+ }
+
@computed get isNotResponding(): boolean {
return (
get(this, 'syncState.status') === WalletSyncStateStatuses.NOT_RESPONDING
diff --git a/source/renderer/app/i18n/locales/defaultMessages.json b/source/renderer/app/i18n/locales/defaultMessages.json
index 5ebba04c68..9efff92923 100644
--- a/source/renderer/app/i18n/locales/defaultMessages.json
+++ b/source/renderer/app/i18n/locales/defaultMessages.json
@@ -3556,226 +3556,6 @@
],
"path": "source/renderer/app/components/staking/delegation-center/DelegationCenterNoWallets.json"
},
- {
- "descriptors": [
- {
- "defaultMessage": "!!!Undelegate",
- "description": "Title for the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 30
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.title",
- "start": {
- "column": 15,
- "line": 26
- }
- },
- {
- "defaultMessage": "!!!Undelegate",
- "description": "Label for the \"Undelegate\" button in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 36
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.confirmButtonLabel",
- "start": {
- "column": 22,
- "line": 31
- }
- },
- {
- "defaultMessage": "!!!The stake from your wallet {walletName} is currently delegated to the [{stakePoolTicker}] {stakePoolName} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
- "description": "Description for the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 42
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.descriptionWithTicker",
- "start": {
- "column": 25,
- "line": 37
- }
- },
- {
- "defaultMessage": "!!!The stake from your wallet {walletName} is currently delegated to the {stakePoolTicker} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
- "description": "Description for the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 49
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.descriptionWithUnknownTicker",
- "start": {
- "column": 32,
- "line": 43
- }
- },
- {
- "defaultMessage": "!!!I understand that I am not supporting the Cardano network when my stake is undelegated.",
- "description": "Label for the unsupport confirmation check in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 56
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.confirmUnsupportCheck",
- "start": {
- "column": 25,
- "line": 50
- }
- },
- {
- "defaultMessage": "!!!I understand that I will not be eligible to earn rewards when my stake is undelegated.",
- "description": "Label for the ineligible confirmation check in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 63
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.confirmIneligibleCheck",
- "start": {
- "column": 26,
- "line": 57
- }
- },
- {
- "defaultMessage": "!!!Fees",
- "description": "Fees label in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 68
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.feesLabel",
- "start": {
- "column": 13,
- "line": 64
- }
- },
- {
- "defaultMessage": "!!!Spending password",
- "description": "Spending password label in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 73
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.spendingPasswordLabel",
- "start": {
- "column": 25,
- "line": 69
- }
- },
- {
- "defaultMessage": "!!!Type your spending password here",
- "description": "Spending password placeholder in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 79
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.spendingPasswordPlaceholder",
- "start": {
- "column": 31,
- "line": 74
- }
- },
- {
- "defaultMessage": "!!!Incorrect spending password.",
- "description": "Label for password error in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 84
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.passwordError",
- "start": {
- "column": 24,
- "line": 80
- }
- },
- {
- "defaultMessage": "!!!unknown",
- "description": "unknown stake pool label in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 89
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.unknownStakePoolLabel",
- "start": {
- "column": 25,
- "line": 85
- }
- },
- {
- "defaultMessage": "!!!Calculating fees",
- "description": "\"Calculating fees\" message in the \"Undelegate\" dialog.",
- "end": {
- "column": 3,
- "line": 94
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.js",
- "id": "staking.delegationCenter.undelegate.dialog.calculatingFees",
- "start": {
- "column": 19,
- "line": 90
- }
- }
- ],
- "path": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog.json"
- },
- {
- "descriptors": [
- {
- "defaultMessage": "!!!Wallet undelegated",
- "description": "Title for the \"Undelegate Result\" dialog.",
- "end": {
- "column": 3,
- "line": 19
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js",
- "id": "staking.delegationCenter.undelegate.result.dialog.title",
- "start": {
- "column": 15,
- "line": 15
- }
- },
- {
- "defaultMessage": "!!!The stake from your wallet {walletName} is no longer delegated and you will soon stop earning rewards for this wallet.",
- "description": "Description 1 for the \"Undelegate Result\" dialog.",
- "end": {
- "column": 3,
- "line": 25
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js",
- "id": "staking.delegationCenter.undelegate.result.dialog.description1",
- "start": {
- "column": 16,
- "line": 20
- }
- },
- {
- "defaultMessage": "!!!Your new delegation preferences are now posted on the blockchain and will take effect after both the current and next Cardano epochs have completed in {timeUntilNextEpochStart} . During this time, your previous delegation preferences are still active.",
- "description": "Description 2 for the \"Undelegate Result\" dialog.",
- "end": {
- "column": 3,
- "line": 31
- },
- "file": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.js",
- "id": "staking.delegationCenter.undelegate.result.dialog.description2",
- "start": {
- "column": 16,
- "line": 26
- }
- }
- ],
- "path": "source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog.json"
- },
{
"descriptors": [
{
@@ -10187,6 +9967,25 @@
],
"path": "source/renderer/app/components/wallet/settings/ChangeSpendingPasswordDialog.json"
},
+ {
+ "descriptors": [
+ {
+ "defaultMessage": "!!!Delegate",
+ "description": "Label for the delegate button on wallet settings",
+ "end": {
+ "column": 3,
+ "line": 12
+ },
+ "file": "source/renderer/app/components/wallet/settings/DelegateWalletButton.js",
+ "id": "wallet.settings.delegateWalletButtonLabel",
+ "start": {
+ "column": 9,
+ "line": 8
+ }
+ }
+ ],
+ "path": "source/renderer/app/components/wallet/settings/DelegateWalletButton.json"
+ },
{
"descriptors": [
{
@@ -10375,6 +10174,259 @@
],
"path": "source/renderer/app/components/wallet/settings/SetWalletPassword.json"
},
+ {
+ "descriptors": [
+ {
+ "defaultMessage": "!!!Undelegate",
+ "description": "Label for the undelegate button on wallet settings",
+ "end": {
+ "column": 3,
+ "line": 12
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletButton.js",
+ "id": "wallet.settings.undelegateWalletButtonLabel",
+ "start": {
+ "column": 9,
+ "line": 8
+ }
+ }
+ ],
+ "path": "source/renderer/app/components/wallet/settings/UndelegateWalletButton.json"
+ },
+ {
+ "descriptors": [
+ {
+ "defaultMessage": "!!!Undelegate",
+ "description": "Title for the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 31
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.title",
+ "start": {
+ "column": 9,
+ "line": 27
+ }
+ },
+ {
+ "defaultMessage": "!!!Undelegate",
+ "description": "Label for the \"Undelegate\" button in the undelegate wallet dialog.",
+ "end": {
+ "column": 3,
+ "line": 37
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.confirmButtonLabel",
+ "start": {
+ "column": 22,
+ "line": 32
+ }
+ },
+ {
+ "defaultMessage": "!!!The stake from your wallet {walletName} is currently delegated to the [{stakePoolTicker}] {stakePoolName} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
+ "description": "Description of current delegation of wallet in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 44
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.descriptionWithTicker",
+ "start": {
+ "column": 25,
+ "line": 38
+ }
+ },
+ {
+ "defaultMessage": "!!!The stake from your wallet {walletName} is currently delegated to the {stakePoolTicker} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
+ "description": "Description of current delegation of wallet in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 51
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.descriptionWithUnknownTicker",
+ "start": {
+ "column": 32,
+ "line": 45
+ }
+ },
+ {
+ "defaultMessage": "!!!unknown",
+ "description": "unknown stake pool label in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 56
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.unknownStakePoolLabel",
+ "start": {
+ "column": 25,
+ "line": 52
+ }
+ },
+ {
+ "defaultMessage": "!!!I understand that I am not supporting the Cardano network when my stake is undelegated.",
+ "description": "Notice to confirm if the user understands unsupporting Cardano network after undelegation",
+ "end": {
+ "column": 3,
+ "line": 63
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.confirmUnsupportNotice",
+ "start": {
+ "column": 26,
+ "line": 57
+ }
+ },
+ {
+ "defaultMessage": "!!!I understand that I will not be eligible to earn rewards when my stake is undelegated.",
+ "description": "Notice to confirm if the user understands non-earning rewards after undelegation",
+ "end": {
+ "column": 3,
+ "line": 70
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.confirmIneligibleNotice",
+ "start": {
+ "column": 27,
+ "line": 64
+ }
+ },
+ {
+ "defaultMessage": "!!!Fees",
+ "description": "Fees label in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 75
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.feesLabel",
+ "start": {
+ "column": 13,
+ "line": 71
+ }
+ },
+ {
+ "defaultMessage": "!!!Deposits reclaimed",
+ "description": "Deposits reclaimed label in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 80
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.depositLabel",
+ "start": {
+ "column": 16,
+ "line": 76
+ }
+ },
+ {
+ "defaultMessage": "!!!Spending password",
+ "description": "Spending password label in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 85
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.spendingPasswordLabel",
+ "start": {
+ "column": 25,
+ "line": 81
+ }
+ },
+ {
+ "defaultMessage": "!!!Type your spending password here",
+ "description": "Spending password placeholder in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 91
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.spendingPasswordPlaceholder",
+ "start": {
+ "column": 31,
+ "line": 86
+ }
+ },
+ {
+ "defaultMessage": "!!!Incorrect spending password.",
+ "description": "Label for password error in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 96
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.passwordError",
+ "start": {
+ "column": 24,
+ "line": 92
+ }
+ },
+ {
+ "defaultMessage": "!!!Calculating fees",
+ "description": "\"Calculating fees\" message in the \"Undelegate wallet\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 102
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.js",
+ "id": "wallet.settings.undelegate.dialog.calculatingFees",
+ "start": {
+ "column": 19,
+ "line": 97
+ }
+ }
+ ],
+ "path": "source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog.json"
+ },
+ {
+ "descriptors": [
+ {
+ "defaultMessage": "!!!Wallet undelegated",
+ "description": "Title for the \"Undelegate Result\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 19
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js",
+ "id": "wallet.settings.undelegate.result.dialog.title",
+ "start": {
+ "column": 9,
+ "line": 15
+ }
+ },
+ {
+ "defaultMessage": "!!!The stake from your wallet {walletName} is no longer delegated and you will soon stop earning rewards for this wallet.",
+ "description": "Description 1 for the \"Undelegate Result\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 25
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js",
+ "id": "wallet.settings.undelegate.result.dialog.description1",
+ "start": {
+ "column": 16,
+ "line": 20
+ }
+ },
+ {
+ "defaultMessage": "!!!Your new delegation preferences are now posted on the blockchain and will take effect after both the current and next Cardano epochs have completed in {timeUntilNextEpochStart} . During this time, your previous delegation preferences are still active.",
+ "description": "Description 2 for the \"Undelegate Result\" dialog.",
+ "end": {
+ "column": 3,
+ "line": 31
+ },
+ "file": "source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.js",
+ "id": "wallet.settings.undelegate.result.dialog.description2",
+ "start": {
+ "column": 16,
+ "line": 26
+ }
+ }
+ ],
+ "path": "source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog.json"
+ },
{
"descriptors": [
{
@@ -10991,13 +11043,97 @@
"description": "Label for the \"Transaction assurance security level\" dropdown.",
"end": {
"column": 3,
- "line": 29
+ "line": 37
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.assurance",
"start": {
"column": 23,
- "line": 24
+ "line": 32
+ }
+ },
+ {
+ "defaultMessage": "!!!Undelegating your wallet",
+ "description": "Undelegate wallet header on the wallet settings page.",
+ "end": {
+ "column": 3,
+ "line": 42
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.undelegateWallet.header",
+ "start": {
+ "column": 26,
+ "line": 38
+ }
+ },
+ {
+ "defaultMessage": "!!!If you are planning to stop using this wallet and remove all funds, you should first undelegate it to recover your 2 ada deposit. You will continue getting delegation rewards during the three Cardano epochs after undelegating your wallet.",
+ "description": "Undelegate wallet warning explaining the consequences.",
+ "end": {
+ "column": 3,
+ "line": 48
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.undelegateWallet.warning",
+ "start": {
+ "column": 27,
+ "line": 43
+ }
+ },
+ {
+ "defaultMessage": "!!!This wallet is synchronizing with the blockchain, so this wallet's delegation status is currently unknown, and undelegation is not possible.",
+ "description": "Undelegate wallet disabled warning explaining why it is disabled.",
+ "end": {
+ "column": 3,
+ "line": 55
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.undelegateWallet.disabledWarning",
+ "start": {
+ "column": 35,
+ "line": 49
+ }
+ },
+ {
+ "defaultMessage": "!!!Delegate your wallet",
+ "description": "Delegate wallet header on the wallet settings page.",
+ "end": {
+ "column": 3,
+ "line": 60
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.delegateWallet.header",
+ "start": {
+ "column": 24,
+ "line": 56
+ }
+ },
+ {
+ "defaultMessage": "!!!This wallet is not delegated. Please, delegate the stake from this wallet to earn rewards and support the Cardano network's security.",
+ "description": "Delegate wallet warning.",
+ "end": {
+ "column": 3,
+ "line": 66
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.delegateWallet.warning",
+ "start": {
+ "column": 25,
+ "line": 61
+ }
+ },
+ {
+ "defaultMessage": "!!!This wallet is synchronizing with the blockchain, so this wallet's delegation status is currently unknown, and delegation is not possible.",
+ "description": "Delegate wallet disabled warning explaining why it is disabled.",
+ "end": {
+ "column": 3,
+ "line": 73
+ },
+ "file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
+ "id": "wallet.settings.delegateWallet.disabledWarning",
+ "start": {
+ "column": 33,
+ "line": 67
}
},
{
@@ -11005,13 +11141,13 @@
"description": "Delete wallet header on the wallet settings page.",
"end": {
"column": 3,
- "line": 34
+ "line": 78
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.deleteWallet.header",
"start": {
"column": 22,
- "line": 30
+ "line": 74
}
},
{
@@ -11019,13 +11155,13 @@
"description": "Delete wallet warning explaining the consequences.",
"end": {
"column": 3,
- "line": 40
+ "line": 84
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.deleteWallet.warning1",
"start": {
"column": 24,
- "line": 35
+ "line": 79
}
},
{
@@ -11033,13 +11169,13 @@
"description": "Delete wallet warning explaining the consequences.",
"end": {
"column": 3,
- "line": 46
+ "line": 90
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.deleteWallet.warning2",
"start": {
"column": 24,
- "line": 41
+ "line": 85
}
},
{
@@ -11047,13 +11183,13 @@
"description": "Label for the \"Name\" text input on the wallet settings page.",
"end": {
"column": 3,
- "line": 51
+ "line": 95
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.name.label",
"start": {
"column": 8,
- "line": 47
+ "line": 91
}
},
{
@@ -11061,13 +11197,13 @@
"description": "Label for the \"Password\" field.",
"end": {
"column": 3,
- "line": 56
+ "line": 100
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.password",
"start": {
"column": 17,
- "line": 52
+ "line": 96
}
},
{
@@ -11075,13 +11211,13 @@
"description": "Last updated X time ago message.",
"end": {
"column": 3,
- "line": 61
+ "line": 105
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.passwordLastUpdated",
"start": {
"column": 23,
- "line": 57
+ "line": 101
}
},
{
@@ -11089,13 +11225,13 @@
"description": "You still don't have password set message.",
"end": {
"column": 3,
- "line": 66
+ "line": 110
},
"file": "source/renderer/app/components/wallet/settings/WalletSettings.js",
"id": "wallet.settings.passwordNotSet",
"start": {
"column": 18,
- "line": 62
+ "line": 106
}
}
],
diff --git a/source/renderer/app/i18n/locales/en-US.json b/source/renderer/app/i18n/locales/en-US.json
index 62804ecf80..6cdaca1e68 100755
--- a/source/renderer/app/i18n/locales/en-US.json
+++ b/source/renderer/app/i18n/locales/en-US.json
@@ -339,21 +339,6 @@
"staking.delegationCenter.stakePoolTooltipTickerEpoch": "From epoch {fromEpoch}",
"staking.delegationCenter.syncingTooltipLabel": "Syncing {syncingProgress}%",
"staking.delegationCenter.totalSlots": "Total slots",
- "staking.delegationCenter.undelegate.dialog.calculatingFees": "Calculating fees",
- "staking.delegationCenter.undelegate.dialog.confirmButtonLabel": "Undelegate",
- "staking.delegationCenter.undelegate.dialog.confirmIneligibleCheck": "I understand that I will not be eligible to earn rewards when my stake is undelegated.",
- "staking.delegationCenter.undelegate.dialog.confirmUnsupportCheck": "I understand that I am not supporting the Cardano network when my stake is undelegated.",
- "staking.delegationCenter.undelegate.dialog.descriptionWithTicker": "The stake from your wallet {walletName} is currently delegated to the [{stakePoolTicker}] {stakePoolName} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
- "staking.delegationCenter.undelegate.dialog.descriptionWithUnknownTicker": "The stake from your wallet {walletName} is currently delegated to the {stakePoolTicker} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
- "staking.delegationCenter.undelegate.dialog.feesLabel": "Fees",
- "staking.delegationCenter.undelegate.dialog.passwordError": "Incorrect spending password.",
- "staking.delegationCenter.undelegate.dialog.spendingPasswordLabel": "Spending password",
- "staking.delegationCenter.undelegate.dialog.spendingPasswordPlaceholder": "Enter spending password",
- "staking.delegationCenter.undelegate.dialog.title": "Undelegate",
- "staking.delegationCenter.undelegate.dialog.unknownStakePoolLabel": "unknown",
- "staking.delegationCenter.undelegate.result.dialog.description1": "The stake from your wallet {walletName} is no longer delegated and you will soon stop earning rewards for this wallet.",
- "staking.delegationCenter.undelegate.result.dialog.description2": "Your new delegation preferences are now posted on the Cardano blockchain. These preferences will take effect after both the current and next Cardano epochs have completed in {timeUntilNextEpochStart}. . During this time, your previous delegation preferences remain active.",
- "staking.delegationCenter.undelegate.result.dialog.title": "Wallet undelegated",
"staking.delegationCenter.unknownStakePoolLabel": "unknown",
"staking.delegationCenter.walletAmount": "{amount} ADA",
"staking.delegationCountdown.buttonLabel": "Learn more",
@@ -949,6 +934,10 @@
"wallet.settings.changePassword.dialog.title.changePassword": "Change password",
"wallet.settings.changePassword.dialog.title.setPassword": "Set a password for {walletName} wallet",
"wallet.settings.copyPublicKey": "Copy public key",
+ "wallet.settings.delegateWallet.disabledWarning": "This wallet is currently synchronizing with the blockchain, so its delegation status is currently unknown, and delegation is not possible.",
+ "wallet.settings.delegateWallet.header": "Delegate your wallet",
+ "wallet.settings.delegateWallet.warning": "This wallet is not delegated. Please delegate the stake from this wallet to earn rewards and support the security of the Cardano network.",
+ "wallet.settings.delegateWalletButtonLabel": "Delegate",
"wallet.settings.delete.dialog.confirmBackupNotice": "I understand that the only way to regain access to this wallet is by restoring it with a wallet recovery phrase.",
"wallet.settings.delete.dialog.confirmButtonLabel": "Delete",
"wallet.settings.delete.dialog.enterRecoveryWordLabel": "Enter the name of the wallet to confirm deletion:",
@@ -1005,6 +994,26 @@
"wallet.settings.setWalletPassword.dialog.setPasswordMessage": "To keep your wallet secure and start using it in Daedalus, you need to set a spending password.",
"wallet.settings.setWalletPassword.dialog.setPasswordTitle": "Your wallet is not protected with a spending password",
"wallet.settings.showQRCode": "Show QR code",
+ "wallet.settings.undelegate.dialog.calculatingFees": "Calculating fees",
+ "wallet.settings.undelegate.dialog.confirmButtonLabel": "Undelegate",
+ "wallet.settings.undelegate.dialog.confirmIneligibleNotice": "I understand that I am not eligible to earn rewards when my stake is undelegated.",
+ "wallet.settings.undelegate.dialog.confirmUnsupportNotice": "I understand that I am not supporting the Cardano network when my stake is undelegated.",
+ "wallet.settings.undelegate.dialog.depositLabel": "Deposits reclaimed",
+ "wallet.settings.undelegate.dialog.descriptionWithTicker": "The stake from your wallet {walletName} is currently delegated to the [{stakePoolTicker}] {stakePoolName} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
+ "wallet.settings.undelegate.dialog.descriptionWithUnknownTicker": "The stake from your wallet {walletName} is currently delegated to the {stakePoolTicker} stake pool.
Do you want to undelegate your stake and stop earning rewards?
",
+ "wallet.settings.undelegate.dialog.feesLabel": "Fees",
+ "wallet.settings.undelegate.dialog.passwordError": "Incorrect spending password.",
+ "wallet.settings.undelegate.dialog.spendingPasswordLabel": "Spending password",
+ "wallet.settings.undelegate.dialog.spendingPasswordPlaceholder": "Type your spending password here",
+ "wallet.settings.undelegate.dialog.title": "Undelegate",
+ "wallet.settings.undelegate.dialog.unknownStakePoolLabel": "unknown",
+ "wallet.settings.undelegate.result.dialog.description1": "The stake from your wallet {walletName} is no longer delegated and you will soon stop earning rewards for this wallet.",
+ "wallet.settings.undelegate.result.dialog.description2": "Your new delegation preferences are now posted on the blockchain and will take effect after both the current and next Cardano epochs have completed in {timeUntilNextEpochStart} . During this time, your previous delegation preferences are still active.",
+ "wallet.settings.undelegate.result.dialog.title": "Wallet undelegated",
+ "wallet.settings.undelegateWallet.disabledWarning": "This wallet is currently synchronizing with the blockchain, so its delegation status is currently unknown, and undelegation is not possible.",
+ "wallet.settings.undelegateWallet.header": "Undelegating your wallet",
+ "wallet.settings.undelegateWallet.warning": "If you are planning to stop using this wallet and withdraw all funds, you should first undelegate the wallet to recover your deposit of 2 ada. You will continue to receive delegation rewards during the three Cardano epochs after your wallet is undelegated.",
+ "wallet.settings.undelegateWalletButtonLabel": "Undelegate",
"wallet.settings.utxos.description": "This wallet contains {formattedWalletAmount} ADA on {walletUtxosAmount} UTXOs (unspent transaction outputs). Examine the histogram below to see the distribution of UTXOs with different amounts of ada.",
"wallet.settings.utxos.emptyWallet": "This wallet is empty so it does not contain any UTXOs (unspent transaction outputs).",
"wallet.settings.utxos.findOutMoreLink": "Find out more",
diff --git a/source/renderer/app/i18n/locales/ja-JP.json b/source/renderer/app/i18n/locales/ja-JP.json
index 01f2905d2f..470b7fb31f 100755
--- a/source/renderer/app/i18n/locales/ja-JP.json
+++ b/source/renderer/app/i18n/locales/ja-JP.json
@@ -339,21 +339,6 @@
"staking.delegationCenter.stakePoolTooltipTickerEpoch": "エポック{fromEpoch}より",
"staking.delegationCenter.syncingTooltipLabel": "同期中 {syncingProgress}%",
"staking.delegationCenter.totalSlots": "総スロット数",
- "staking.delegationCenter.undelegate.dialog.calculatingFees": "手数料を計算しています",
- "staking.delegationCenter.undelegate.dialog.confirmButtonLabel": "委任を解除する",
- "staking.delegationCenter.undelegate.dialog.confirmIneligibleCheck": "ステークを委任していないと、報酬を得られないことを理解しました。",
- "staking.delegationCenter.undelegate.dialog.confirmUnsupportCheck": "ステークを委任していないと、Cardanoネットワークをサポートできないことを理解しました。",
- "staking.delegationCenter.undelegate.dialog.descriptionWithTicker": "{walletName} ウォレットのステークは現在「{stakePoolTicker}」 {stakePoolName} ステークプールに委任されています。
ステークの委任を解除して報酬の獲得を停止しますか。
",
- "staking.delegationCenter.undelegate.dialog.descriptionWithUnknownTicker": "{walletName} ウォレットのステークは現在{stakePoolTicker} ステークプールに委任されています。
ステークの委任を解除して報酬の獲得を停止しますか。
",
- "staking.delegationCenter.undelegate.dialog.feesLabel": "手数料",
- "staking.delegationCenter.undelegate.dialog.passwordError": "送金時パスワードが間違っています。",
- "staking.delegationCenter.undelegate.dialog.spendingPasswordLabel": "送信時パスワード",
- "staking.delegationCenter.undelegate.dialog.spendingPasswordPlaceholder": "送信時パスワードを入力してください",
- "staking.delegationCenter.undelegate.dialog.title": "委任を解除する",
- "staking.delegationCenter.undelegate.dialog.unknownStakePoolLabel": "不明の",
- "staking.delegationCenter.undelegate.result.dialog.description1": "{walletName} ウォレットのステークは現在委任されておらず、まもなくこのウォレットへの報酬は停止されます。",
- "staking.delegationCenter.undelegate.result.dialog.description2": "新しい委任設定はCardanoブロックチェーンに送信されました。この設定は現行の次のCardanoエポックが{timeUntilNextEpochStart}後に終了すると有効になります。 それまでは、変更前の委任設定が有効のままとなります。",
- "staking.delegationCenter.undelegate.result.dialog.title": "ウォレット委任は解除されました",
"staking.delegationCenter.unknownStakePoolLabel": "不明の",
"staking.delegationCenter.walletAmount": "{amount} ADA",
"staking.delegationCountdown.buttonLabel": "もっと知る",
@@ -949,6 +934,10 @@
"wallet.settings.changePassword.dialog.title.changePassword": "パスワードを変更する",
"wallet.settings.changePassword.dialog.title.setPassword": "{walletName}ウォレットにパスワードを設定する",
"wallet.settings.copyPublicKey": "公開鍵をコピーする",
+ "wallet.settings.delegateWallet.disabledWarning": "このウォレットは現在ブロックチェーンと同期中のため、委任設定状況は不明であり、委任設定はできません。",
+ "wallet.settings.delegateWallet.header": "ウォレットを委任する",
+ "wallet.settings.delegateWallet.warning": "このウォレットは委任されていません。このウォレットのステークを委任し、報酬を稼ぎ、Cardanoネットワークのセキュリティをサポートしてください。",
+ "wallet.settings.delegateWalletButtonLabel": "委任する",
"wallet.settings.delete.dialog.confirmBackupNotice": "削除したウォレットに再びアクセスする唯一の方法は、ウォレット復元フレーズを使用して復元することであると理解しました。",
"wallet.settings.delete.dialog.confirmButtonLabel": "削除する",
"wallet.settings.delete.dialog.enterRecoveryWordLabel": "削除するウォレット名を入力して確認してください:",
@@ -1005,6 +994,26 @@
"wallet.settings.setWalletPassword.dialog.setPasswordMessage": "ウォレットを安全に保ち、Daedalus で使用するためには、送信時パスワードの設定が必要です。",
"wallet.settings.setWalletPassword.dialog.setPasswordTitle": "このウォレットは送信時パスワードで保護されていません",
"wallet.settings.showQRCode": "QRコードを表示する",
+ "wallet.settings.undelegate.dialog.calculatingFees": "手数料を計算しています",
+ "wallet.settings.undelegate.dialog.confirmButtonLabel": "委任設定を解除する",
+ "wallet.settings.undelegate.dialog.confirmIneligibleNotice": "ステークを委任していないと、報酬を得られないことを理解しました。",
+ "wallet.settings.undelegate.dialog.confirmUnsupportNotice": "ステークを委任していないと、Cardanoネットワークをサポートできないことを理解しました。",
+ "wallet.settings.undelegate.dialog.depositLabel": "デポジットは返還されました",
+ "wallet.settings.undelegate.dialog.descriptionWithTicker": "{walletName} ウォレットのステークは現在[{stakePoolTicker}] {stakePoolName} ステークプールに委任されています。
ステークの委任を解除し、報酬獲得を停止しますか。
",
+ "wallet.settings.undelegate.dialog.descriptionWithUnknownTicker": "{walletName} ウォレットのステークは現在{stakePoolTicker} ステークプールに委任されています。
ステークの委任を解除して報酬の獲得を停止しますか。
",
+ "wallet.settings.undelegate.dialog.feesLabel": "手数料",
+ "wallet.settings.undelegate.dialog.passwordError": "送金時パスワードが間違っています。",
+ "wallet.settings.undelegate.dialog.spendingPasswordLabel": "送信時パスワード",
+ "wallet.settings.undelegate.dialog.spendingPasswordPlaceholder": "送金時パスワードを入力して下さい",
+ "wallet.settings.undelegate.dialog.title": "委任設定を解除する",
+ "wallet.settings.undelegate.dialog.unknownStakePoolLabel": "不明の",
+ "wallet.settings.undelegate.result.dialog.description1": "{walletName} ウォレットのステークは現在委任されておらず、まもなくこのウォレットへの報酬は停止されます。",
+ "wallet.settings.undelegate.result.dialog.description2": "新しい委任設定はブロックチェーンに送信され、現行のCardanoエポックと次のエポックが{timeUntilNextEpochStart}後に終了となり次第有効になります。 それまでは、変更前の委任設定が有効のままとなります。",
+ "wallet.settings.undelegate.result.dialog.title": "ウォレットの委任設定が解除されました",
+ "wallet.settings.undelegateWallet.disabledWarning": "このウォレットは現在ブロックチェーンと同期中のため、委任設定状況は不明であり、委任設定の解除はできません。",
+ "wallet.settings.undelegateWallet.header": "ウォレットの委任設定を解除する",
+ "wallet.settings.undelegateWallet.warning": "このウォレットの使用を停止し、すべての資金を移す場合には、まず委任設定を解除し、デポジットの2ADAを回収してください。ウォレットの委任設定を解除後、3Cardanoエポック間は委任報酬が継続します。",
+ "wallet.settings.undelegateWalletButtonLabel": "委任設定を解除する",
"wallet.settings.utxos.description": "このウォレットには、{walletUtxosAmount} のUTXO (未使用トランザクションアウトプット)に{formattedWalletAmount} ADA が含まれています。含まれるADAの額ごとのUTXO分布状況は、下のグラフで確認できます。",
"wallet.settings.utxos.emptyWallet": "このウォレットは空のため、UTXO(未使用トランザクションアウトプット)はありません。",
"wallet.settings.utxos.findOutMoreLink": "もっと知る",
diff --git a/source/renderer/app/stores/StakingStore.js b/source/renderer/app/stores/StakingStore.js
index b91ae99cc3..f1d1672aa8 100644
--- a/source/renderer/app/stores/StakingStore.js
+++ b/source/renderer/app/stores/StakingStore.js
@@ -297,16 +297,24 @@ export default class StakingStore extends Store {
};
@action _quitStakePool = async (request: QuitStakePoolRequest) => {
- const { walletId, passphrase } = request;
+ const { walletId, passphrase, isHardwareWallet } = request;
// Set quit transaction in "PENDING" state
this.isDelegationTransactionPending = true;
try {
- const quitTransaction = await this.quitStakePoolRequest.execute({
- walletId,
- passphrase,
- });
+ let quitTransaction;
+ if (isHardwareWallet) {
+ quitTransaction = await this.stores.hardwareWallets._sendMoney({
+ isDelegationTransaction: true,
+ });
+ } else {
+ quitTransaction = await this.quitStakePoolRequest.execute({
+ walletId,
+ passphrase,
+ });
+ }
+
// Start interval to check transaction state every second
this.delegationCheckTimeInterval = setInterval(
this.checkDelegationTransaction,
@@ -458,7 +466,7 @@ export default class StakingStore extends Store {
wallet.pendingDelegations && wallet.pendingDelegations.length > 0;
let lastDelegatedStakePoolId = wallet.delegatedStakePoolId;
if (hasPendingDelegations) {
- lastDelegatedStakePoolId = wallet.lastDelegationStakePoolId;
+ lastDelegatedStakePoolId = wallet.lastDelegatedStakePoolId;
}
if (lastDelegatedStakePoolId) {
const delegatingStakePoolExistInList = find(
diff --git a/source/renderer/app/stores/WalletsStore.js b/source/renderer/app/stores/WalletsStore.js
index cea8237c9a..a3d122bb57 100644
--- a/source/renderer/app/stores/WalletsStore.js
+++ b/source/renderer/app/stores/WalletsStore.js
@@ -29,8 +29,8 @@ import {
WALLET_HARDWARE_KINDS,
RESTORE_WALLET_STEPS,
} from '../config/walletRestoreConfig';
+import { IS_WALLET_PUBLIC_KEY_SHARING_ENABLED } from '../config/walletsConfig';
import { CURRENCY_REQUEST_RATE_INTERVAL } from '../config/currencyConfig';
-import { WALLET_PUBLIC_KEY_SHARING_ENABLED } from '../config/walletsConfig';
import type {
WalletKind,
WalletDaedalusKind,
@@ -46,6 +46,7 @@ import type {
TransferFundsCalculateFeeRequest,
TransferFundsRequest,
} from '../api/wallets/types';
+import type { QuitStakePoolRequest } from '../api/staking/types';
import type {
TransportDevice,
HardwareWalletExtendedPublicKeyResponse,
@@ -307,7 +308,7 @@ export default class WalletsStore extends Store {
}
@action _getWalletPublicKey = async () => {
- if (!this.active || !WALLET_PUBLIC_KEY_SHARING_ENABLED) {
+ if (!this.active || !IS_WALLET_PUBLIC_KEY_SHARING_ENABLED) {
return;
}
@@ -675,11 +676,7 @@ export default class WalletsStore extends Store {
this.refreshWalletsData();
};
- _undelegateWallet = async (params: {
- walletId: string,
- stakePoolId: string,
- passphrase: string,
- }) => {
+ _undelegateWallet = async (params: QuitStakePoolRequest) => {
const { quitStakePoolRequest } = this.stores.staking;
const { quitStakePool } = this.actions.staking;
const walletToUndelegate = this.getWalletById(params.walletId);
diff --git a/source/renderer/app/themes/daedalus/cardano.js b/source/renderer/app/themes/daedalus/cardano.js
index 04115f37a9..294756beef 100644
--- a/source/renderer/app/themes/daedalus/cardano.js
+++ b/source/renderer/app/themes/daedalus/cardano.js
@@ -395,7 +395,7 @@ export const CARDANO_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#ffffff',
'--theme-news-feed-icon-color-connecting-screen': '#ffffff',
'--theme-news-feed-icon-color-syncing-screen': '#5e6066',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -711,6 +711,9 @@ export const CARDANO_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#2cbb69',
'--theme-settings-theme-select-title-color': '#5e6066',
'--theme-settings-theme-select-border-color': '#d2d3d3',
+ '--theme-settings-undelegate-wallet-divider-border-color': '#dfe4e8',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#4a5058',
diff --git a/source/renderer/app/themes/daedalus/dark-blue.js b/source/renderer/app/themes/daedalus/dark-blue.js
index 775d1115af..a35e87594d 100644
--- a/source/renderer/app/themes/daedalus/dark-blue.js
+++ b/source/renderer/app/themes/daedalus/dark-blue.js
@@ -399,7 +399,7 @@ export const DARK_BLUE_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#e9f4fe',
'--theme-news-feed-icon-color-connecting-screen': '#e9f4fe',
'--theme-news-feed-icon-color-syncing-screen': '#e9f4fe',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -715,6 +715,9 @@ export const DARK_BLUE_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#536370',
'--theme-settings-theme-select-title-color': '#cecfd1',
'--theme-settings-theme-select-border-color': 'rgba(102, 122, 138, 0.3)',
+ '--theme-settings-undelegate-wallet-divider-border-color': '#334152',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#314259',
diff --git a/source/renderer/app/themes/daedalus/dark-cardano.js b/source/renderer/app/themes/daedalus/dark-cardano.js
index 8f69668f5f..ab49d6a663 100644
--- a/source/renderer/app/themes/daedalus/dark-cardano.js
+++ b/source/renderer/app/themes/daedalus/dark-cardano.js
@@ -378,7 +378,7 @@ export const DARK_CARDANO_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#ffffff',
'--theme-news-feed-icon-color-connecting-screen': '#ffffff',
'--theme-news-feed-icon-color-syncing-screen': '#ffffff',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -694,6 +694,10 @@ export const DARK_CARDANO_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#1fc1c3',
'--theme-settings-theme-select-title-color': '#ffffff',
'--theme-settings-theme-select-border-color': 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-divider-border-color':
+ 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#36374d',
diff --git a/source/renderer/app/themes/daedalus/flight-candidate.js b/source/renderer/app/themes/daedalus/flight-candidate.js
index d1553196c4..3616e4cabb 100644
--- a/source/renderer/app/themes/daedalus/flight-candidate.js
+++ b/source/renderer/app/themes/daedalus/flight-candidate.js
@@ -378,7 +378,7 @@ export const FLIGHT_CANDIDATE_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#ffffff',
'--theme-news-feed-icon-color-connecting-screen': '#ffffff',
'--theme-news-feed-icon-color-syncing-screen': '#ffffff',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -692,6 +692,10 @@ export const FLIGHT_CANDIDATE_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#ffb923',
'--theme-settings-theme-select-title-color': '#ffffff',
'--theme-settings-theme-select-border-color': 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-divider-border-color':
+ 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#36374d',
diff --git a/source/renderer/app/themes/daedalus/incentivized-testnet.js b/source/renderer/app/themes/daedalus/incentivized-testnet.js
index 9bfbe3ddb9..48c49d1882 100644
--- a/source/renderer/app/themes/daedalus/incentivized-testnet.js
+++ b/source/renderer/app/themes/daedalus/incentivized-testnet.js
@@ -379,7 +379,7 @@ export const INCENTIVIZED_TESTNET_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#ffffff',
'--theme-news-feed-icon-color-connecting-screen': '#ffffff',
'--theme-news-feed-icon-color-syncing-screen': '#ffffff',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -694,6 +694,10 @@ export const INCENTIVIZED_TESTNET_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#eb2256',
'--theme-settings-theme-select-title-color': '#ffffff',
'--theme-settings-theme-select-border-color': 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-divider-border-color':
+ 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#eb4a22',
},
sidebar: {
'--theme-sidebar-background-color': '#36374d',
diff --git a/source/renderer/app/themes/daedalus/light-blue.js b/source/renderer/app/themes/daedalus/light-blue.js
index d91c8b46de..fbceefbdd9 100644
--- a/source/renderer/app/themes/daedalus/light-blue.js
+++ b/source/renderer/app/themes/daedalus/light-blue.js
@@ -394,7 +394,7 @@ export const LIGHT_BLUE_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#fafbfc',
'--theme-news-feed-icon-color-connecting-screen': '#fafbfc',
'--theme-news-feed-icon-color-syncing-screen': '#5e6066',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -708,6 +708,9 @@ export const LIGHT_BLUE_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#445b7c',
'--theme-settings-theme-select-title-color': '#5e6066',
'--theme-settings-theme-select-border-color': '#c6cdd6',
+ '--theme-settings-undelegate-wallet-divider-border-color': '#dfe4e8',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#345078',
diff --git a/source/renderer/app/themes/daedalus/shelley-testnet.js b/source/renderer/app/themes/daedalus/shelley-testnet.js
index 176b2595fa..5a9c91aaf3 100644
--- a/source/renderer/app/themes/daedalus/shelley-testnet.js
+++ b/source/renderer/app/themes/daedalus/shelley-testnet.js
@@ -378,7 +378,7 @@ export const SHELLEY_TESTNET_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#ffffff',
'--theme-news-feed-icon-color-connecting-screen': '#ffffff',
'--theme-news-feed-icon-color-syncing-screen': '#ffffff',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(0, 0, 0, 0.1)',
@@ -692,6 +692,10 @@ export const SHELLEY_TESTNET_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#898ee6',
'--theme-settings-theme-select-title-color': '#ffffff',
'--theme-settings-theme-select-border-color': 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-divider-border-color':
+ 'rgba(255, 255, 255, 0.2)',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#36374d',
diff --git a/source/renderer/app/themes/daedalus/white.js b/source/renderer/app/themes/daedalus/white.js
index 0f80ccdff0..16ca7248f3 100644
--- a/source/renderer/app/themes/daedalus/white.js
+++ b/source/renderer/app/themes/daedalus/white.js
@@ -382,7 +382,7 @@ export const WHITE_THEME_OUTPUT = {
'--theme-news-feed-icon-color': '#2d2d2d',
'--theme-news-feed-icon-color-connecting-screen': '#2d2d2d',
'--theme-news-feed-icon-color-syncing-screen': '#2d2d2d',
- '--theme-news-feed-icon-green-dot-background-color': '#2DC06C',
+ '--theme-news-feed-icon-green-dot-background-color': '#2dc06c',
'--theme-news-feed-icon-red-dot-background-color': '#ea4c5b',
'--theme-news-feed-icon-toggle-hover-background-color':
'rgba(41, 181, 149, 0.1)',
@@ -700,6 +700,10 @@ export const WHITE_THEME_OUTPUT = {
'--theme-settings-menu-item-left-border-color-active': '#29b595',
'--theme-settings-theme-select-title-color': '#2d2d2d',
'--theme-settings-theme-select-border-color': '#fff',
+ '--theme-settings-undelegate-wallet-divider-border-color':
+ 'rgba(45, 45, 45, 0.1)',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#2dc06c',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#ffffff',
diff --git a/source/renderer/app/themes/daedalus/yellow.js b/source/renderer/app/themes/daedalus/yellow.js
index 1a5d9f9ece..4661d8d85c 100644
--- a/source/renderer/app/themes/daedalus/yellow.js
+++ b/source/renderer/app/themes/daedalus/yellow.js
@@ -699,6 +699,9 @@ export const YELLOW_THEME_OUTPUT = {
'rgba(45, 45, 45, 1)',
'--theme-settings-theme-select-title-color': '#2d2d2d',
'--theme-settings-theme-select-border-color': '#e1dac6',
+ '--theme-settings-undelegate-wallet-divider-border-color': '#e1dac6',
+ '--theme-settings-undelegate-wallet-deposit-amount-color': '#009900',
+ '--theme-settings-undelegate-wallet-fees-amount-color': '#ea4c5b',
},
sidebar: {
'--theme-sidebar-background-color': '#fdcd68',
diff --git a/source/renderer/app/themes/utils/createTheme.js b/source/renderer/app/themes/utils/createTheme.js
index 1d96d831cc..8f330464df 100644
--- a/source/renderer/app/themes/utils/createTheme.js
+++ b/source/renderer/app/themes/utils/createTheme.js
@@ -917,6 +917,9 @@ export const createDaedalusComponentsTheme = (
'--theme-settings-menu-item-left-border-color-active': `${background.secondary.regular}`,
'--theme-settings-theme-select-title-color': `${text.primary}`,
'--theme-settings-theme-select-border-color': `${border}`,
+ '--theme-settings-undelegate-wallet-divider-border-color': `${border}`,
+ '--theme-settings-undelegate-wallet-deposit-amount-color': `${background.primary.regular}`,
+ '--theme-settings-undelegate-wallet-fees-amount-color': `${error.regular}`,
},
sidebar: {
'--theme-sidebar-background-color': `${background.secondary.regular}`,
diff --git a/storybook/stories/_support/utils.js b/storybook/stories/_support/utils.js
index b3c402d9db..7712f1e434 100644
--- a/storybook/stories/_support/utils.js
+++ b/storybook/stories/_support/utils.js
@@ -96,7 +96,8 @@ export const generateWallet = (
reward?: number = 0,
delegatedStakePool?: StakePool,
hasPassword?: boolean,
- status?: SyncStateStatus = WalletSyncStateStatuses.READY
+ status?: SyncStateStatus = WalletSyncStateStatuses.READY,
+ isHardwareWallet?: boolean = false
) =>
new Wallet({
id: generateHash(),
@@ -110,6 +111,7 @@ export const generateWallet = (
passwordUpdateDate: new Date(),
syncState: { status, ...statusProgress(status) },
isLegacy: false,
+ isHardwareWallet,
discovery: 'random',
recoveryPhraseVerificationDate: new Date(),
recoveryPhraseVerificationStatus: RECOVERY_PHRASE_VERIFICATION_STATUSES.OK,
diff --git a/storybook/stories/staking/DelegationSteps.stories.js b/storybook/stories/staking/DelegationSteps.stories.js
index 27e6e12ce6..19ce46d9aa 100644
--- a/storybook/stories/staking/DelegationSteps.stories.js
+++ b/storybook/stories/staking/DelegationSteps.stories.js
@@ -125,7 +125,8 @@ export class StakingDelegationSteps extends Component {
key="DelegationStepsConfirmationDialog"
transactionFee={{
fee: new BigNumber(0.172081),
- deposit: new BigNumber(2),
+ deposits: new BigNumber(2),
+ depositsReclaimed: new BigNumber(0),
}}
stepsList={getDelegationWizardStepsList(this.props.locale)}
selectedPool={STAKE_POOLS[0]}
diff --git a/storybook/stories/staking/Staking.stories.js b/storybook/stories/staking/Staking.stories.js
index 38d37e2f81..67b61a43da 100644
--- a/storybook/stories/staking/Staking.stories.js
+++ b/storybook/stories/staking/Staking.stories.js
@@ -1,7 +1,7 @@
// @flow
import React from 'react';
import { storiesOf } from '@storybook/react';
-import { withKnobs, date, number } from '@storybook/addon-knobs';
+import { withKnobs, date, number, boolean } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import StoryLayout from '../_support/StoryLayout';
import StoryProvider from '../_support/StoryProvider';
@@ -237,9 +237,18 @@ storiesOf('Decentralization | Staking', module)
id: 'wizard',
}
)
- .add('Undelegate Confirmation', StakingUndelegateConfirmationStory, {
- id: 'undelegate-confirmation',
- })
+ .add(
+ 'Undelegate Confirmation',
+ (props) => (
+
+ ),
+ {
+ id: 'undelegate-confirmation',
+ }
+ )
.add(
'Undelegate Confirmation - unknownn stake pool',
diff --git a/storybook/stories/staking/Undelegate.stories.js b/storybook/stories/staking/Undelegate.stories.js
index 5ed5d647b1..f5f436901f 100644
--- a/storybook/stories/staking/Undelegate.stories.js
+++ b/storybook/stories/staking/Undelegate.stories.js
@@ -3,16 +3,36 @@ import React from 'react';
import BigNumber from 'bignumber.js';
import moment from 'moment';
import { linkTo } from '@storybook/addon-links';
+import { number } from '@storybook/addon-knobs';
+import STAKE_POOLS from '../../../source/renderer/app/config/stakingStakePools.dummy.json';
+import { generateWallet } from '../_support/utils';
// Screens
-import UndelegateConfirmationDialog from '../../../source/renderer/app/components/staking/delegation-center/UndelegateConfirmationDialog';
-import UndelegateConfirmationResultDialog from '../../../source/renderer/app/components/staking/delegation-center/UndelegateConfirmationResultDialog';
+import UndelegateWalletConfirmationDialog from '../../../source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog';
+import UndelegateWalletSuccessDialog from '../../../source/renderer/app/components/wallet/settings/UndelegateWalletSuccessDialog';
+
+const generalWallet = generateWallet(
+ 'Wallet 1',
+ '1000000000',
+ 0,
+ STAKE_POOLS[0]
+);
+const hardwareWallet = generateWallet(
+ 'Wallet 1',
+ '10000000',
+ 0,
+ STAKE_POOLS[0],
+ false,
+ 'ready',
+ true
+);
export const StakingUndelegateConfirmationStory = (props: {
unknownStakePool?: boolean,
+ isHardwareWallet?: boolean,
}) => (
- null}
isSubmitting={false}
error={null}
- fees={new BigNumber(33333.33)}
+ fees={{
+ fee: new BigNumber(number('fee', 3)),
+ deposits: new BigNumber(0),
+ depositsReclaimed: new BigNumber(number('depositsReclaimed', 10)),
+ }}
+ hwDeviceStatus="ready"
/>
);
@@ -32,7 +57,7 @@ export const StakingUndelegateConfirmationResultStory = ({
}: {
locale: string,
}) => (
- null}
diff --git a/storybook/stories/wallets/settings/WalletSettingsScreen.stories.js b/storybook/stories/wallets/settings/WalletSettingsScreen.stories.js
index 67ee42051c..43a4691d5c 100644
--- a/storybook/stories/wallets/settings/WalletSettingsScreen.stories.js
+++ b/storybook/stories/wallets/settings/WalletSettingsScreen.stories.js
@@ -2,14 +2,20 @@
import React from 'react';
import { text, boolean, number, select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
+import BigNumber from 'bignumber.js';
import moment from 'moment';
-import { isIncentivizedTestnetTheme } from '../../_support/utils';
+import {
+ isIncentivizedTestnetTheme,
+ generateWallet,
+} from '../../_support/utils';
+import STAKE_POOLS from '../../../../source/renderer/app/config/stakingStakePools.dummy.json';
import type { Locale } from '../../../../source/common/types/locales.types';
// Screens
import WalletSettings from '../../../../source/renderer/app/components/wallet/settings/WalletSettings';
import ChangeSpendingPasswordDialog from '../../../../source/renderer/app/components/wallet/settings/ChangeSpendingPasswordDialog';
import WalletPublicKeyQRCodeDialog from '../../../../source/renderer/app/components/wallet/settings/WalletPublicKeyQRCodeDialog';
+import UndelegateWalletConfirmationDialog from '../../../../source/renderer/app/components/wallet/settings/UndelegateWalletConfirmationDialog';
import DeleteWalletConfirmationDialog from '../../../../source/renderer/app/components/wallet/settings/DeleteWalletConfirmationDialog';
import WalletRecoveryPhraseStep1Dialog from '../../../../source/renderer/app/components/wallet/settings/WalletRecoveryPhraseStep1Dialog';
import WalletRecoveryPhraseStep2Dialog from '../../../../source/renderer/app/components/wallet/settings/WalletRecoveryPhraseStep2Dialog';
@@ -25,6 +31,7 @@ import {
const basicSettingsId = 'Basic Settings';
const changePasswordId = 'Change Password';
+const undelegateWalletId = 'Undelegate Wallet';
const deleteWalletId = 'Delete Wallet';
const walletPublicKeyId = 'Wallet Public Key';
const recoveryPhraseId = 'Recovery Phrase';
@@ -64,6 +71,13 @@ const recoveryDialogOptions = {
'Step 4 - Verification failure': 4,
};
+const selectedWallet = generateWallet(
+ 'Wallet 1',
+ '1000000000',
+ 0,
+ STAKE_POOLS[0]
+);
+
const getWalletDates = (type: string, status: string) => {
let date = new Date();
if (status === 'warning')
@@ -106,6 +120,16 @@ export default (props: { currentTheme: string, locale: Locale }) => {
recoveryPhraseId
);
+ const delegationStakePoolStatus = select(
+ 'Delegation status',
+ {
+ Delegating: 'delegating',
+ 'Not delegating': 'not_delegating',
+ },
+ 'delegating',
+ undelegateWalletId
+ );
+
return (
{
onStartEditing={() => {}}
onStopEditing={() => {}}
openDialogAction={() => {}}
+ walletId="walletid"
walletName={text('Wallet Name', 'Wallet Name', basicSettingsId)}
+ delegationStakePoolStatus={delegationStakePoolStatus}
+ lastDelegationStakePoolStatus={delegationStakePoolStatus}
+ isRestoring={false}
+ isSyncing={false}
walletPublicKey={walletPublicKeyId}
spendingPasswordUpdateDate={moment().subtract(1, 'month').toDate()}
isSpendingPasswordSet={boolean(
@@ -191,6 +220,32 @@ export default (props: { currentTheme: string, locale: Locale }) => {
onClose={action('Wallet Public Key QR Code - onClose')}
/>
}
+ undelegateWalletDialogContainer={
+
+ }
deleteWalletDialogContainer={
{
}
onVerifyRecoveryPhrase={action('onVerifyRecoveryPhrase')}
onCopyWalletPublicKey={() => null}
+ updateDataForActiveDialogAction={() => null}
+ onDelegateClick={() => null}
getWalletPublicKey={() => null}
creationDate={creationDate}
recoveryPhraseVerificationDate={recoveryPhraseVerificationDate}