Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
semeano committed Dec 20, 2024
2 parents a92c3e6 + 698c42f commit 9870642
Show file tree
Hide file tree
Showing 128 changed files with 1,476 additions and 5,171 deletions.
10 changes: 10 additions & 0 deletions .changeset/forty-turtles-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@ledgerhq/cryptoassets": minor
"@ledgerhq/types-live": minor
"@ledgerhq/coin-cosmos": minor
"ledger-live-desktop": minor
"live-mobile": minor
"@ledgerhq/live-common": minor
---

move crypto_org into cosmos coin module
5 changes: 5 additions & 0 deletions .changeset/hungry-ravens-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Choosing a new provider outside the ledger one is now displayed in the modal
14 changes: 14 additions & 0 deletions .changeset/loud-spiders-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@ledgerhq/types-cryptoassets": minor
"@ledgerhq/cryptoassets": minor
"@ledgerhq/types-live": minor
"@ledgerhq/coin-cosmos": minor
"@ledgerhq/crypto-icons-ui": minor
"ledger-live-desktop": minor
"live-mobile": minor
"@ledgerhq/live-common": minor
"@ledgerhq/web-tools": minor
"@ledgerhq/live-cli": minor
---

add xion currency
5 changes: 5 additions & 0 deletions .changeset/moody-oranges-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

Set default value for swap exchanges
5 changes: 5 additions & 0 deletions .changeset/nine-toes-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Fix camera rendering right after granting access
5 changes: 5 additions & 0 deletions .changeset/stale-guests-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

LLM - Add an ellipsis to the Add account title when too long
6 changes: 6 additions & 0 deletions .changeset/swift-cherries-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"live-mobile": minor
---

Stake for BNB will open directly the Stakekit live app
6 changes: 6 additions & 0 deletions .changeset/unlucky-clocks-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"live-mobile": minor
---

Adds LNS error on LLM when swapping unsupported assets. Updates translations
2 changes: 1 addition & 1 deletion .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
CI_OS: "ubuntu-latest"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
runs-on: [ledger-live-4xlarge]
runs-on: [ledger-live-4xlarge-e2e]
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/live-common-setup-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ setSupportedCurrencies([
"zksync",
"zksync_sepolia",
"mantra",
"xion",
]);

for (const k in process.env) setEnvUnsafe(k as EnvName, process.env[k]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ setSupportedCurrencies([
"zksync",
"zksync_sepolia",
"mantra",
"xion",
]);
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export default function BalanceInfos({
state: {
from: history.location.pathname,
defaultAccount,
defaultAmountFrom: "0",
defaultParentAccount: parentAccount,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export default function AccountContextMenu({
state: {
defaultCurrency: currency,
defaultAccount: account,
defaultAmountFrom: "0",
defaultParentAccount: parentAccount,
from: history.location.pathname,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ type Props = {
};
function CosmosFamilyValidatorRow({ validator, active, onClick, unit, currency }: Props) {
const explorerView = getDefaultExplorerView(currency);
const currencyName = currency.name.toLowerCase();
const currencyID = currency.id;

const ledgerValidatorUrl = useLocalizedUrl(urls.ledgerValidator);
const onExternalLink = useCallback(
(address: string) => {
const ledgerValidator = cryptoFactory(currencyName).ledgerValidator;
const ledgerValidator = cryptoFactory(currencyID).ledgerValidator;
if (address === ledgerValidator) {
openURL(ledgerValidatorUrl);
} else {
const srURL = explorerView && getAddressExplorer(explorerView, address);
if (srURL) openURL(srURL);
}
},
[currencyName, explorerView, ledgerValidatorUrl],
[currencyID, explorerView, ledgerValidatorUrl],
);
return (
<StyledValidatorRow
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions apps/ledger-live-desktop/src/renderer/families/crypto_org/index.ts

This file was deleted.

14 changes: 0 additions & 14 deletions apps/ledger-live-desktop/src/renderer/families/crypto_org/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import IconCoins from "~/renderer/icons/Coins";
import { openModal } from "~/renderer/actions/modals";
import { isAccountEmpty } from "@ledgerhq/live-common/account/index";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";
import { useHistory } from "react-router";

type Props = {
account: AccountLike;
Expand All @@ -13,10 +14,26 @@ type Props = {

const AccountHeaderActions = ({ account, parentAccount }: Props) => {
const dispatch = useDispatch();
const history = useHistory();
const label = useGetStakeLabelLocaleBased();

const isEthereumAccount = account.type === "Account" && account.currency.id === "ethereum";
const isBscAccount = account.type === "Account" && account.currency.id === "bsc";

const onClickStakekit = useCallback(() => {
const value = "/platform/stakekit";

history.push({
pathname: value,
state: {
yieldId: "bsc-bnb-native-staking",
accountId: account.id,
returnTo: `/account/${account.id}`,
},
});
}, [account.id, history]);

const onClickStake = useCallback(() => {
const onClickStakeModal = useCallback(() => {
if (isAccountEmpty(account)) {
dispatch(
openModal("MODAL_NO_FUNDS_STAKE", {
Expand All @@ -33,11 +50,19 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
}
}, [account, dispatch, parentAccount]);

if (isEthereumAccount) {
const getStakeAction = useCallback(() => {
if (isEthereumAccount) {
onClickStakeModal();
} else if (isBscAccount) {
onClickStakekit();
}
}, [isEthereumAccount, isBscAccount, onClickStakeModal, onClickStakekit]);

if (isEthereumAccount || isBscAccount) {
return [
{
key: "Stake",
onClick: onClickStake,
onClick: getStakeAction,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useValidators } from "@ledgerhq/live-common/families/solana/react";
import { ValidatorsAppValidator } from "@ledgerhq/live-common/families/solana/staking";
import { SolanaAccount } from "@ledgerhq/live-common/families/solana/types";

import React, { useState, useCallback } from "react";
import React, { useState, useCallback, useEffect } from "react";
import { Trans } from "react-i18next";
import styled from "styled-components";
import Box from "~/renderer/components/Box";
Expand All @@ -23,6 +23,8 @@ type Props = {
const ValidatorField = ({ account, onChangeValidator, chosenVoteAccAddr }: Props) => {
const [search, setSearch] = useState("");
const [showAll, setShowAll] = useState(false);
const [currentValidator, setCurrentValidator] = useState<ValidatorsAppValidator[]>([]);

const unit = useAccountUnit(account);
const validators = useValidators(account.currency, search);

Expand All @@ -31,6 +33,21 @@ const ValidatorField = ({ account, onChangeValidator, chosenVoteAccAddr }: Props
[setSearch],
);

useEffect(() => {
const selectedVoteAccAddr = validators.find(p => p.voteAccount === chosenVoteAccAddr);
if (selectedVoteAccAddr) {
const isDefault = validators.slice(0, 2).includes(selectedVoteAccAddr);
if (isDefault) {
setCurrentValidator([selectedVoteAccAddr]);
}
setCurrentValidator([
selectedVoteAccAddr,
...validators.slice(0, 2).filter(v => v !== selectedVoteAccAddr),
]);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [chosenVoteAccAddr]);

const renderItem = (validator: ValidatorsAppValidator) => {
return (
<ValidatorRow
Expand All @@ -49,7 +66,13 @@ const ValidatorField = ({ account, onChangeValidator, chosenVoteAccAddr }: Props
<ValidatorsFieldContainer>
<Box p={1} data-testid="validator-list">
<ScrollLoadingList
data={showAll ? validators : validators.slice(0, 2)}
data={
showAll
? validators
: currentValidator.length > 0
? currentValidator
: validators.slice(0, 2)
}
style={{
flex: showAll ? "1 0 240px" : "1 0 126px",
marginBottom: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
const zksync = useFeature("currencyZkSync");
const zksyncSepolia = useFeature("currencyZkSyncSepolia");
const mantra = useFeature("currencyMantra");
const xion = useFeature("currencyXion");

const featureFlaggedCurrencies = useMemo(
(): Partial<Record<CryptoCurrencyId, Feature<unknown> | null>> => ({
Expand Down Expand Up @@ -142,6 +143,7 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
zksync,
zksync_sepolia: zksyncSepolia,
mantra,
xion,
}),
[
aptos,
Expand Down Expand Up @@ -196,6 +198,7 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
zksync,
zksyncSepolia,
mantra,
xion,
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ const AccountHeaderActions = ({ account, parentAccount, openModal }: Props) => {
defaultCurrency: currency,
defaultAccount: account,
defaultParentAccount: parentAccount,
defaultAmountFrom: "0",
from: history.location.pathname,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default function AssetBalanceSummaryHeader({
defaultAccount: account,
defaultParentAccount: parentAccount,
defaultCurrency: currency,
defaultAmountFrom: "0",
from: history.location.pathname,
},
});
Expand Down
Loading

0 comments on commit 9870642

Please sign in to comment.