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

feat: MultichainBalanceController #12599

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2b5c61d
add MultichainBalanceController
owencraston Dec 6, 2024
66466da
fix multichain selectors
owencraston Jan 24, 2025
7ea3f13
hide precentage changed for non evm
owencraston Jan 24, 2025
c2f9855
add solana constants
owencraston Jan 27, 2025
93cde2c
support solana asset balance
owencraston Jan 27, 2025
d7f7509
use constants from assets controller
owencraston Jan 27, 2025
6d64737
render sol balance as fiat
owencraston Jan 27, 2025
ee267ac
cleanup
owencraston Jan 27, 2025
f0bc3b9
update Tokens test
owencraston Jan 27, 2025
65b8082
remove console log
owencraston Jan 27, 2025
cdb29ae
refresh non evm balances onRefresh
owencraston Jan 28, 2025
cb26c06
address feedback
owencraston Jan 28, 2025
06f5692
render solana tokens
owencraston Jan 28, 2025
051008b
render test net icons
owencraston Jan 28, 2025
68f6f7a
improve multichainNonEvm selector tests
owencraston Jan 29, 2025
95a3a36
improve tests
owencraston Jan 29, 2025
9182592
debugging tests
owencraston Jan 29, 2025
7a87334
fix non evm tests
owencraston Jan 29, 2025
e5caf33
selectMultichainShouldShowFiat test
owencraston Jan 29, 2025
d8ec28c
selectMultichainIsBitcoin tests
owencraston Jan 29, 2025
c19a3e0
test selectMultichainSelectedAccountCachedBalance
owencraston Jan 29, 2025
71e3c1c
test selectMultichainDefaultToken
owencraston Jan 29, 2025
bee10c4
selectMultichainConversionRate test
owencraston Jan 29, 2025
a9e8dfd
test case where we show fiat on testnet
owencraston Jan 29, 2025
b07fd0b
test solana accounts
owencraston Jan 29, 2025
7fe8b82
basic NonEvmToken test
owencraston Jan 29, 2025
33fc12f
remove broken test
owencraston Jan 29, 2025
b6e2ea3
update name toisPortfolioVieEnabled
owencraston Jan 29, 2025
5578510
address feedback
owencraston Jan 29, 2025
cfa9778
define more actions/event types
owencraston Jan 29, 2025
a37506e
include CurrencyRateController:stateChange in allow list
owencraston Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { Provider } from 'react-redux';
import AggregatedPercentage, {
AggregatedPercentageProps,
} from './AggregatedPercentage';
import AggregatedPercentage from './AggregatedPercentage';
import { createStore } from 'redux';
import initialBackgroundState from '../../../../util/test/initial-background-state.json';

import { AggregatedPercentageProps } from './AggregatedPercentage.types';
const mockInitialState = {
wizard: {
step: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ import {
FORMATTED_PERCENTAGE_TEST_ID,
} from './AggregatedPercentage.constants';
import { DECIMALS_TO_SHOW } from '../../../../components/UI/Tokens/constants';

export interface AggregatedPercentageProps {
ethFiat: number;
tokenFiat: number;
tokenFiat1dAgo: number;
ethFiat1dAgo: number;
}
import { AggregatedPercentageProps } from './AggregatedPercentage.types';

const isValidAmount = (amount: number | null | undefined): boolean =>
amount !== null && amount !== undefined && !Number.isNaN(amount);
Expand All @@ -32,13 +26,7 @@ const AggregatedPercentage = ({
tokenFiat1dAgo,
ethFiat1dAgo,
privacyMode = false,
}: {
ethFiat: number;
tokenFiat: number;
tokenFiat1dAgo: number;
ethFiat1dAgo: number;
privacyMode?: boolean;
}) => {
}: AggregatedPercentageProps) => {
const { styles } = useStyles(styleSheet, {});

const currentCurrency = useSelector(selectCurrentCurrency);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface AggregatedPercentageProps {
ethFiat: number;
tokenFiat: number;
tokenFiat1dAgo: number;
ethFiat1dAgo: number;
privacyMode?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ import {
TokensWithBalances,
} from '../../../../components/hooks/useGetFormattedTokensPerChain';
import { getFormattedAmountChange, getPercentageTextColor } from './utils';

export interface AggregatedPercentageProps {
ethFiat: number;
tokenFiat: number;
tokenFiat1dAgo: number;
ethFiat1dAgo: number;
}
import { AggregatedPercentageCrossChainsProps } from './AggregatedPercentageCrossChains.types';

export const getCalculatedTokenAmount1dAgo = (
tokenFiatBalance: number,
Expand All @@ -40,16 +34,7 @@ const AggregatedPercentageCrossChains = ({
privacyMode = false,
totalFiatCrossChains,
tokenFiatBalancesCrossChains,
}: {
privacyMode?: boolean;
totalFiatCrossChains: number;
tokenFiatBalancesCrossChains: {
chainId: string;
nativeFiatValue: number;
tokenFiatBalances: number[];
tokensWithBalances: TokensWithBalances[];
}[];
}) => {
}: AggregatedPercentageCrossChainsProps) => {
const crossChainMarketData: MarketDataMapping = useSelector(
selectTokenMarketData,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { TokensWithBalances } from '../../../../components/hooks/useGetFormattedTokensPerChain';

export interface AggregatedPercentageCrossChainsProps {
privacyMode?: boolean;
totalFiatCrossChains: number;
tokenFiatBalancesCrossChains: {
chainId: string;
nativeFiatValue: number;
tokenFiatBalances: number[];
tokensWithBalances: TokensWithBalances[];
}[];
}
Loading
Loading