Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2769a9359e | ||
|
|
575856b77b | ||
|
|
e3609782ed |
@@ -8,67 +8,43 @@
|
|||||||
],
|
],
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
"/": "/trade/*"
|
"/": "/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/r/*"
|
"/": "/#/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/overview"
|
"/": "*/markets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/positions"
|
"/": "*/trade"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/orders"
|
"/": "*/trade/*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/fees"
|
"/": "*/portfolio"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history"
|
"/": "*/portfolio/overview"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/trades"
|
"/": "*/portfolio/positions"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/transfers"
|
"/": "*/portfolio/orders"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/funding"
|
"/": "*/portfolio/fees"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/rewards"
|
"/": "*/portfolio/history/trades"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/my-profile"
|
"/": "*/portfolio/history/transfers"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/rankings/hedgies"
|
"/": "*/portfolio/history/funding"
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/competition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/diamond"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/platinum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/gold"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/silver"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/bronze"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/pnl-absolute"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/pnl-percent"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/walletsegue",
|
"/": "/walletsegue",
|
||||||
|
|||||||
@@ -56,15 +56,15 @@
|
|||||||
"endpoints": {
|
"endpoints": {
|
||||||
"indexers": [
|
"indexers": [
|
||||||
{
|
{
|
||||||
"api": "http://indexer.v4dev.dydx.exchange",
|
"api": "https://indexer.v4dev.dydx.exchange",
|
||||||
"socket": "wss://indexer.v4dev.dydx.exchange"
|
"socket": "wss://indexer.v4dev.dydx.exchange"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"validators": [
|
"validators": [
|
||||||
"http://validator.v4dev.dydx.exchange"
|
"https://validator.v4dev.dydx.exchange"
|
||||||
],
|
],
|
||||||
"0xsquid": "https://testnet.api.0xsquid.com",
|
"0xsquid": "https://testnet.api.0xsquid.com",
|
||||||
"faucet": "http://faucet.v4dev.dydx.exchange"
|
"faucet": "https://faucet.v4dev.dydx.exchange"
|
||||||
},
|
},
|
||||||
"links": {
|
"links": {
|
||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { useQuery } from 'react-query';
|
|||||||
import { formatUnits } from 'viem';
|
import { formatUnits } from 'viem';
|
||||||
|
|
||||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
import { QUANTUM_MULTIPLIER } from '@/constants/numbers';
|
|
||||||
import { EvmAddress } from '@/constants/wallets';
|
import { EvmAddress } from '@/constants/wallets';
|
||||||
|
|
||||||
import { convertBech32Address } from '@/lib/addressUtils';
|
import { convertBech32Address } from '@/lib/addressUtils';
|
||||||
@@ -21,7 +20,6 @@ import { useTokenConfigs } from './useTokenConfigs';
|
|||||||
type UseAccountBalanceProps = {
|
type UseAccountBalanceProps = {
|
||||||
// Token Items
|
// Token Items
|
||||||
addressOrDenom?: string;
|
addressOrDenom?: string;
|
||||||
assetSymbol?: string;
|
|
||||||
decimals?: number;
|
decimals?: number;
|
||||||
|
|
||||||
// Chain Items
|
// Chain Items
|
||||||
@@ -40,7 +38,6 @@ export const CHAIN_DEFAULT_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeee
|
|||||||
|
|
||||||
export const useAccountBalance = ({
|
export const useAccountBalance = ({
|
||||||
addressOrDenom,
|
addressOrDenom,
|
||||||
assetSymbol,
|
|
||||||
bech32AddrPrefix,
|
bech32AddrPrefix,
|
||||||
chainId,
|
chainId,
|
||||||
decimals = 0,
|
decimals = 0,
|
||||||
@@ -91,7 +88,7 @@ export const useAccountBalance = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { formatted: evmBalance } = evmQuery.data || {};
|
const { formatted: evmBalance } = evmQuery.data || {};
|
||||||
const balance = !assetSymbol ? '0' : isCosmosChain ? cosmosQuery.data : evmBalance;
|
const balance = isCosmosChain ? cosmosQuery.data : evmBalance;
|
||||||
|
|
||||||
const nativeTokenCoinBalance = balances?.[chainTokenDenom];
|
const nativeTokenCoinBalance = balances?.[chainTokenDenom];
|
||||||
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount);
|
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount);
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import { OnboardingTriggerButton } from '@/views/dialogs/OnboardingTriggerButton
|
|||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
import { calculateCanAccountTrade } from '@/state/accountCalculators';
|
import { calculateCanAccountTrade } from '@/state/accountCalculators';
|
||||||
|
|
||||||
// TODO(@aforaleka): replace with real data
|
|
||||||
export const DYDXBalancePanel = () => {
|
export const DYDXBalancePanel = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
@@ -110,7 +109,7 @@ export const DYDXBalancePanel = () => {
|
|||||||
value: (
|
value: (
|
||||||
<Output
|
<Output
|
||||||
type={OutputType.Asset}
|
type={OutputType.Asset}
|
||||||
value={nativeTokenBalance + nativeStakingBalance}
|
value={nativeTokenBalance.plus(nativeStakingBalance)}
|
||||||
tag={chainTokenLabel}
|
tag={chainTokenLabel}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -126,7 +125,7 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
|
|
||||||
Styled.Header = styled.div`
|
Styled.Header = styled.div`
|
||||||
${layoutMixins.spacedRow}
|
${layoutMixins.spacedRow}
|
||||||
padding: 1.25rem 1.5rem 0.5rem;
|
padding: 1rem 1.5rem 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Title = styled.h3`
|
Styled.Title = styled.h3`
|
||||||
@@ -155,7 +154,6 @@ Styled.ReceiveButton = styled(Button)`
|
|||||||
Styled.Content = styled.div`
|
Styled.Content = styled.div`
|
||||||
${layoutMixins.flexColumn}
|
${layoutMixins.flexColumn}
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
padding: 0 0.5rem 0.5rem;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.IconContainer = styled.div`
|
Styled.IconContainer = styled.div`
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
|||||||
// Async Data
|
// Async Data
|
||||||
const { balance, queryStatus, isQueryFetching } = useAccountBalance({
|
const { balance, queryStatus, isQueryFetching } = useAccountBalance({
|
||||||
addressOrDenom: sourceToken?.address || CHAIN_DEFAULT_TOKEN_ADDRESS,
|
addressOrDenom: sourceToken?.address || CHAIN_DEFAULT_TOKEN_ADDRESS,
|
||||||
assetSymbol: sourceToken?.symbol || undefined,
|
|
||||||
chainId: chainId,
|
chainId: chainId,
|
||||||
decimals: sourceToken?.decimals || undefined,
|
decimals: sourceToken?.decimals || undefined,
|
||||||
isCosmosChain: false,
|
isCosmosChain: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user