Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiversx rebranding bis #8757

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .changeset/purple-balloons-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@ledgerhq/types-cryptoassets": patch
"@ledgerhq/hw-app-multiversx": patch
"@ledgerhq/cryptoassets": patch
"@ledgerhq/coin-multiversx": patch
"@actions/turbo-affected": patch
"ledger-live-desktop": patch
"live-mobile": patch
"@ledgerhq/live-common": patch
"@ledgerhq/web-tools": patch
"@ledgerhq/ledger-libs": patch
"@ledgerhq/live-cli": patch
"@ledgerhq/live-env": patch
---

chore: Rebranding from 'Elrond' to 'MultiversX'
2 changes: 1 addition & 1 deletion apps/cli/src/live-common-setup-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setSupportedCurrencies([
"dash",
"tron",
"tezos",
"elrond",
"elrond", // NOTE: legacy 'multiversx' name, kept for compatibility
"ethereum_classic",
"zcash",
"decred",
Expand Down
6 changes: 3 additions & 3 deletions apps/ledger-live-desktop/src/config/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const urls = {
algorandStakingRewards: "https://support.ledger.com/article/360015897740-zd",
nearStakingRewards: "https://support.ledger.com/article/360020450619-zd",
polkadotFeesInfo: "https://support.ledger.com/article/360016289919-zd",
elrondStaking: "https://support.ledger.com/article/7228337345693-zd",
multiversxStaking: "https://support.ledger.com/article/7228337345693-zd",
xpubLearnMore: "https://support.ledger.com/article/360011069619-zd",
ledgerValidator: "https://www.ledger.com/staking",
// Banners
Expand Down Expand Up @@ -146,8 +146,8 @@ export const urls = {
cryptoOrg: {
website: "https://cronos-pos.org",
},
elrond: {
website: "https://elrond.com",
multiversx: {
website: "https://multiversx.com",
},
figment: {
website: "https://www.figment.io",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ setSupportedCurrencies([
"dash",
"tron",
"tezos",
"elrond",
"elrond", // NOTE: legacy 'multiversx' name, kept for compatibility
"ethereum_classic",
"zcash",
"decred",
Expand Down
30 changes: 0 additions & 30 deletions apps/ledger-live-desktop/src/renderer/families/elrond/modals.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
Balance,
Title,
TitleWrapper,
} from "~/renderer/families/elrond/blocks/Summary";
} from "~/renderer/families/multiversx/blocks/Summary";
import { DelegationType } from "./types";
import { ElrondAccount } from "@ledgerhq/live-common/families/elrond/types";
import { MultiversXAccount } from "@ledgerhq/live-common/families/multiversx/types";
import { SubAccount } from "@ledgerhq/types-live";
import { useAccountUnit } from "~/renderer/hooks/useAccountUnit";

Expand All @@ -26,23 +26,27 @@ interface BalanceType {
amount: BigNumber;
}

const Summary = (props: { account: ElrondAccount }) => {
const Summary = (props: { account: MultiversXAccount }) => {
const { account } = props;
const [balance, setBalance] = useState<BigNumber>(account.spendableBalance);
const [delegationsResources, setDelegationResources] = useState(
account.elrondResources ? account.elrondResources.delegations : [],
account.multiversxResources ? account.multiversxResources.delegations : [],
);
const discreet = useDiscreetMode();
const locale = useSelector(localeSelector);
const unit = useAccountUnit(account);
const fetchDelegations = useCallback(() => {
setBalance(account.spendableBalance);
setDelegationResources(account.elrondResources ? account.elrondResources.delegations : []);
setDelegationResources(
account.multiversxResources ? account.multiversxResources.delegations : [],
);
return () => {
setBalance(account.spendableBalance);
setDelegationResources(account.elrondResources ? account.elrondResources.delegations : []);
setDelegationResources(
account.multiversxResources ? account.multiversxResources.delegations : [],
);
};
}, [account.elrondResources, account.spendableBalance]);
}, [account.multiversxResources, account.spendableBalance]);
const delegations = useMemo(
(): BigNumber =>
delegationsResources.reduce(
Expand Down Expand Up @@ -110,7 +114,7 @@ const Summary = (props: { account: ElrondAccount }) => {
);
};

function AccountBalanceSummaryFooter({ account }: { account: ElrondAccount | SubAccount }) {
function AccountBalanceSummaryFooter({ account }: { account: MultiversXAccount | SubAccount }) {
if (account.type !== "Account") return null;
return <Summary account={account} />;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { useCallback, useMemo } from "react";
import { useDispatch } from "react-redux";
import { hasMinimumDelegableBalance } from "@ledgerhq/live-common/families/elrond/helpers";
import { useElrondRandomizedValidators } from "@ledgerhq/live-common/families/elrond/react";
import { hasMinimumDelegableBalance } from "@ledgerhq/live-common/families/multiversx/helpers";
import { useMultiversXRandomizedValidators } from "@ledgerhq/live-common/families/multiversx/react";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { SubAccount } from "@ledgerhq/types-live";
import { ElrondAccount } from "@ledgerhq/live-common/families/elrond/types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";
import { MultiversXAccount } from "@ledgerhq/live-common/families/multiversx/types";

const AccountHeaderManageActions = (props: {
account: ElrondAccount | SubAccount;
parentAccount?: ElrondAccount | null;
account: MultiversXAccount | SubAccount;
parentAccount?: MultiversXAccount | null;
source?: string;
}) => {
const { account, source } = props;
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();
const validators = useElrondRandomizedValidators();
const validators = useMultiversXRandomizedValidators();

const earnRewardEnabled = useMemo(
() => account.type === "Account" && hasMinimumDelegableBalance(account),
[account],
);

const hasDelegations =
account.type === "Account" && account.elrondResources
? account.elrondResources.delegations.length > 0
account.type === "Account" && account.multiversxResources
? account.multiversxResources.delegations.length > 0
: false;

const onClick = useCallback(() => {
Expand All @@ -34,15 +34,15 @@ const AccountHeaderManageActions = (props: {
dispatch(openModal("MODAL_NO_FUNDS_STAKE", { account }));
} else if (hasDelegations) {
dispatch(
openModal("MODAL_ELROND_DELEGATE", {
openModal("MODAL_MULTIVERSX_DELEGATE", {
account,
validators,
source,
}),
);
} else {
dispatch(
openModal("MODAL_ELROND_REWARDS_INFO", {
openModal("MODAL_MULTIVERSX_REWARDS_INFO", {
account,
validators,
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Fragment, useState } from "react";
import { ElrondAccount } from "@ledgerhq/live-common/families/elrond/types";
import { MultiversXAccount } from "@ledgerhq/live-common/families/multiversx/types";
import { Trans, useTranslation } from "react-i18next";
import { SubAccount } from "@ledgerhq/types-live";
import styled from "styled-components";
Expand All @@ -13,7 +13,7 @@ import AccountSubHeaderDrawer from "~/renderer/components/AccountSubHeader/Accou
import Alert from "~/renderer/components/Alert";

export interface AccountSubHeaderPropsType {
account: ElrondAccount | SubAccount;
account: MultiversXAccount | SubAccount;
}

const CardContent = styled(Box)`
Expand Down Expand Up @@ -43,8 +43,8 @@ const AccountSubHeader = ({ account }: AccountSubHeaderPropsType) => {
const { t } = useTranslation();

const isGuarded =
account.type === "Account" && account.elrondResources
? account.elrondResources.isGuarded
account.type === "Account" && account.multiversxResources
? account.multiversxResources.isGuarded
: false;

const openDrawer = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useDispatch } from "react-redux";
import { Trans } from "react-i18next";
import styled from "styled-components";
import { BigNumber } from "bignumber.js";
import { useElrondRandomizedValidators } from "@ledgerhq/live-common/families/elrond/react";
import { denominate } from "@ledgerhq/live-common/families/elrond/helpers";
import { hasMinimumDelegableBalance } from "@ledgerhq/live-common/families/elrond/helpers";
import { useMultiversXRandomizedValidators } from "@ledgerhq/live-common/families/multiversx/react";
import { denominate } from "@ledgerhq/live-common/families/multiversx/helpers";
import { hasMinimumDelegableBalance } from "@ledgerhq/live-common/families/multiversx/helpers";
import Text from "~/renderer/components/Text";
import Button from "~/renderer/components/Button";
import Box from "~/renderer/components/Box";
Expand All @@ -15,16 +15,20 @@ import ToolTip from "~/renderer/components/Tooltip";
import ClaimRewards from "~/renderer/icons/ClaimReward";
import DelegateIcon from "~/renderer/icons/Delegate";
import TableContainer, { TableHeader } from "~/renderer/components/TableContainer";
import Unbondings from "~/renderer/families/elrond/components/Unbondings";
import Delegations from "~/renderer/families/elrond/components/Delegations";
import Unbondings from "~/renderer/families/multiversx/components/Unbondings";
import Delegations from "~/renderer/families/multiversx/components/Delegations";
import { urls } from "~/config/urls";
import { openURL } from "~/renderer/linking";
import { openModal } from "~/renderer/actions/modals";
import { DelegationType, ElrondFamily, UnbondingType } from "~/renderer/families/elrond/types";
import { ElrondAccount } from "@ledgerhq/live-common/families/elrond/types";
import {
DelegationType,
MultiversXFamily,
UnbondingType,
} from "~/renderer/families/multiversx/types";
import { MultiversXAccount } from "@ledgerhq/live-common/families/multiversx/types";

export interface DelegationPropsType {
account: ElrondAccount;
account: MultiversXAccount;
}
const Wrapper = styled(Box).attrs(() => ({
p: 3,
Expand All @@ -37,9 +41,9 @@ const Wrapper = styled(Box).attrs(() => ({
/* eslint-disable react/display-name */
const Delegation = (props: DelegationPropsType) => {
const { account } = props;
const validators = useElrondRandomizedValidators();
const validators = useMultiversXRandomizedValidators();
const [delegationResources, setDelegationResources] = useState<DelegationType[]>(
account.elrondResources ? account.elrondResources.delegations : [],
account.multiversxResources ? account.multiversxResources.delegations : [],
);

const dispatch = useDispatch();
Expand Down Expand Up @@ -96,13 +100,17 @@ const Delegation = (props: DelegationPropsType) => {
[delegationResources, findValidator],
);
const fetchDelegations = useCallback(() => {
setDelegationResources(account.elrondResources ? account.elrondResources.delegations : []);
setDelegationResources(
account.multiversxResources ? account.multiversxResources.delegations : [],
);
return () =>
setDelegationResources(account.elrondResources ? account.elrondResources.delegations : []);
}, [account.elrondResources]);
setDelegationResources(
account.multiversxResources ? account.multiversxResources.delegations : [],
);
}, [account.multiversxResources]);
const onEarnRewards = useCallback(() => {
dispatch(
openModal("MODAL_ELROND_REWARDS_INFO", {
openModal("MODAL_MULTIVERSX_REWARDS_INFO", {
account,
validators,
delegations,
Expand All @@ -112,7 +120,7 @@ const Delegation = (props: DelegationPropsType) => {
const onDelegate = useCallback(() => {
if (validators) {
dispatch(
openModal("MODAL_ELROND_DELEGATE", {
openModal("MODAL_MULTIVERSX_DELEGATE", {
account,
validators,
delegations,
Expand All @@ -123,7 +131,7 @@ const Delegation = (props: DelegationPropsType) => {
const onClaimRewards = useCallback(() => {
if (validators && delegations) {
dispatch(
openModal("MODAL_ELROND_CLAIM_REWARDS", {
openModal("MODAL_MULTIVERSX_CLAIM_REWARDS", {
account,
validators,
delegations,
Expand Down Expand Up @@ -215,7 +223,7 @@ const Delegation = (props: DelegationPropsType) => {
<Box mt={2}>
<LinkWithExternalIcon
label={<Trans i18nKey="elrond.delegation.emptyState.info" />}
onClick={() => openURL(urls.elrondStaking)}
onClick={() => openURL(urls.multiversxStaking)}
/>
</Box>
</Box>
Expand Down Expand Up @@ -251,7 +259,7 @@ const Delegation = (props: DelegationPropsType) => {
);
};

const EarnRewards: ElrondFamily["AccountBodyHeader"] = ({ account }) => {
const EarnRewards: MultiversXFamily["AccountBodyHeader"] = ({ account }) => {
return account.type === "Account" ? <Delegation account={account} /> : null;
};

Expand Down
Loading
Loading