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

chalabi/cross chain x #194

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2c7c09d
chore: remove hardcoded chainNames
chalabi2 Jan 9, 2025
a7aceac
feat: add osmosis balances
chalabi2 Jan 9, 2025
2d1826e
chore: add ibc mocks, token filters/queries, addresses etc
chalabi2 Jan 10, 2025
178dd55
successful ibc tx generation
chalabi2 Jan 10, 2025
27b7338
fix: timeout time/height in ibcTransfer
chalabi2 Jan 10, 2025
0020ea8
Merge branch 'main' into chalabi/cross-chain-x
chalabi2 Jan 10, 2025
758500e
feat: add switcher to ibc chain selectors
chalabi2 Jan 10, 2025
2a4826a
chore: add group ibc functionality
chalabi2 Jan 11, 2025
03619b3
fix: show ibc assets in history
chalabi2 Jan 11, 2025
0ec0be6
Merge branch 'main' into chalabi/cross-chain-x
chalabi2 Jan 11, 2025
dc163e0
chore: add back uppercase
chalabi2 Jan 11, 2025
aa9301f
chore: code rabbit suggestions
chalabi2 Jan 11, 2025
6f565da
chore: code rabbit suggestions
chalabi2 Jan 11, 2025
dbeeec5
fix: merge conflicts
chalabi2 Jan 14, 2025
5a0f4c1
chore: add osmosis related .env variables to readme
chalabi2 Jan 14, 2025
f7ce672
fix: re-add proper rendering logic to bank page
chalabi2 Jan 14, 2025
5cea9f3
Update README.md
chalabi2 Jan 14, 2025
fb9cfff
Update README.md
chalabi2 Jan 14, 2025
09bf705
Update config/env.ts
chalabi2 Jan 14, 2025
7b1a642
chore: add coderabbit changes
chalabi2 Jan 14, 2025
6d570b0
Update config/env.ts
chalabi2 Jan 14, 2025
bd0319f
Update config/env.ts
chalabi2 Jan 14, 2025
958a27f
Update components/bank/components/sendBox.tsx
chalabi2 Jan 14, 2025
de95589
Update pages/_app.tsx
chalabi2 Jan 14, 2025
1e474cf
Update pages/bank.tsx
chalabi2 Jan 14, 2025
036be3f
Update scripts/ibcTransferAll.ts
chalabi2 Jan 14, 2025
65dbb12
Update scripts/ibcTransferAll.ts
chalabi2 Jan 14, 2025
f0e7e8d
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
52672ce
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
d7bcb83
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
3e1c22f
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
38129b1
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
16da549
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
ed1b3ee
Update components/bank/forms/ibcSendForm.tsx
chalabi2 Jan 14, 2025
c748bc0
Update hooks/useLcdQueryClient.ts
chalabi2 Jan 14, 2025
3ff70b4
Update hooks/useLcdQueryClient.ts
chalabi2 Jan 14, 2025
e50afae
Update hooks/useTx.tsx
chalabi2 Jan 14, 2025
891c4b6
chore: add transfer script instructions
chalabi2 Jan 14, 2025
2cd2f92
chore: prettier
chalabi2 Jan 14, 2025
5fef3a4
fix: fix form tests
chalabi2 Jan 14, 2025
6562154
fix: add mocked osmosis asset list
chalabi2 Jan 14, 2025
915a268
fix: move chain selection test to ibc test file
chalabi2 Jan 14, 2025
d6d8ddb
fix: incrase wait time for slow ci machine
chalabi2 Jan 14, 2025
e367ae2
remove loading state from ibc form mock in sendbox
chalabi2 Jan 14, 2025
a47b3d2
fix: proper module mock path for ibcSendForm in sendbox test
chalabi2 Jan 14, 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ next-env.d.ts

.idea/

certificates
certificates

/scripts/demons.json
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ NEXT_PUBLIC_RPC_URL=
NEXT_PUBLIC_API_URL=
NEXT_PUBLIC_EXPLORER_URL=
NEXT_PUBLIC_INDEXER_URL=
NEXT_PUBLIC_OSMOSIS_CHAIN_ID=
NEXT_PUBLIC_OSMOSIS_RPC_URL=
NEXT_PUBLIC_OSMOSIS_API_URL=
NEXT_PUBLIC_OSMOSIS_EXPLORER_URL=
```

where
Expand All @@ -45,6 +49,10 @@ where
- `NEXT_PUBLIC_API_URL` is the chain API URL
- `NEXT_PUBLIC_EXPLORER_URL` is the block explorer URL
- `NEXT_PUBLIC_INDEXER_URL` is the YACI indexer URL
- `NEXT_PUBLIC_OSMOSIS_CHAIN_ID` is the osmosis chain ID
- `NEXT_PUBLIC_OSMOSIS_RPC_URL` is the osmosis RPC URL
- `NEXT_PUBLIC_OSMOSIS_API_URL` is the osmosis API URL
- `NEXT_PUBLIC_OSMOSIS_EXPLORER_URL` is the osmosis block explorer URL

### Development

Expand Down
78 changes: 48 additions & 30 deletions components/bank/components/__tests__/sendBox.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, afterEach, describe, mock, jest } from 'bun:test';
import React from 'react';
import matchers from '@testing-library/jest-dom/matchers';
import { screen, cleanup, waitFor, fireEvent } from '@testing-library/react';
import { screen, cleanup, waitFor, fireEvent, within } from '@testing-library/react';
import SendBox from '@/components/bank/components/sendBox';
import { mockBalances } from '@/tests/mock';
import { renderWithChainProvider } from '@/tests/render';
Expand All @@ -17,12 +17,45 @@ mock.module('next/router', () => ({
}),
}));

// Add this mock before your tests
mock.module('next/image', () => ({
default: (props: any) => {
// eslint-disable-next-line @next/next/no-img-element
return <img {...props} alt={props.alt || ''} />;
},
}));

// Add this mock at the top of your test file
mock.module('@/components/bank/forms/ibcSendForm', () => ({
default: (props: any) => {
return (
<div data-testid="ibc-send-form">
<div className="dropdown">
<label tabIndex={0} aria-label="from-chain-selector" className="btn">
{props.selectedFromChain || 'Select Chain'}
</label>
</div>
<div className="dropdown">
<label tabIndex={0} aria-label="to-chain-selector" className="btn">
{props.selectedToChain || 'Select Chain'}
</label>
</div>
</div>
);
},
}));

const renderWithProps = (props = {}) => {
const defaultProps = {
address: 'test_address',
balances: mockBalances,
isBalancesLoading: false,
refetchBalances: () => {},
refetchHistory: () => {},
osmosisBalances: [],
isOsmosisBalancesLoading: false,
refetchOsmosisBalances: () => {},
resolveOsmosisRefetch: () => {},
};
return renderWithChainProvider(<SendBox {...defaultProps} {...props} />);
};
Expand All @@ -40,42 +73,27 @@ describe('SendBox', () => {

test('toggles between Send and Cross-Chain Transfer', async () => {
renderWithProps();
expect(screen.getByText('Amount')).toBeInTheDocument();

fireEvent.click(screen.getByText('Cross-Chain Transfer'));
await waitFor(() => expect(screen.getByText('Chain')).toBeInTheDocument());
});

test('displays chain selection dropdown when in Cross-Chain Transfer mode', async () => {
renderWithProps();
fireEvent.click(screen.getByText('Cross-Chain Transfer'));
await waitFor(() => expect(screen.getByText('Chain')).toBeInTheDocument());
});

test('selects a chain in Cross-Chain Transfer mode', async () => {
renderWithProps();
const crossChainBtn = screen.getByLabelText('cross-chain-transfer-tab');
fireEvent.click(crossChainBtn);

await waitFor(() => {
const chainSelector = screen.getByLabelText('chain-selector');
expect(chainSelector).toBeTruthy();
});
// Check initial send form
expect(screen.getByPlaceholderText('0.00')).toBeInTheDocument();
expect(screen.queryByLabelText('to-chain-selector')).not.toBeInTheDocument();

const chainSelector = screen.getByLabelText('chain-selector');
fireEvent.click(chainSelector);
// Switch to cross-chain transfer
fireEvent.click(screen.getByLabelText('cross-chain-transfer-tab'));

// Verify cross-chain elements are present
await waitFor(() => {
const osmosisOption = screen.getByText('Osmosis');
expect(osmosisOption).toBeTruthy();
expect(screen.getByLabelText('from-chain-selector')).toBeInTheDocument();
expect(screen.getByLabelText('to-chain-selector')).toBeInTheDocument();
});
});

const osmosisOption = screen.getByText('Osmosis');
fireEvent.click(osmosisOption);
test('displays chain selection dropdowns in Cross-Chain Transfer mode', async () => {
renderWithProps();
fireEvent.click(screen.getByLabelText('cross-chain-transfer-tab'));

await waitFor(() => {
const updatedChainSelector = screen.getByLabelText('chain-selector');
expect(updatedChainSelector.textContent).toContain('Osmosis');
expect(screen.getByLabelText('from-chain-selector')).toBeInTheDocument();
expect(screen.getByLabelText('to-chain-selector')).toBeInTheDocument();
});
});
});
65 changes: 60 additions & 5 deletions components/bank/components/historyBox.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useMemo, useState, useEffect } from 'react';
import { TruncatedAddressWithCopy } from '@/components/react/addressCopy';
import TxInfoModal from '../modals/txInfo';
import { shiftDigits, truncateString } from '@/utils';
import { denomToAsset, shiftDigits, truncateString } from '@/utils';
import { BurnIcon, DenomImage, formatDenom, MintIcon } from '@/components';
import { HistoryTxType, useTokenFactoryDenomsMetadata } from '@/hooks';
import { ReceiveIcon, SendIcon } from '@/components/icons';

import useIsMobile from '@/hooks/useIsMobile';
import env from '@/config/env';

interface Transaction {
tx_type: HistoryTxType;
Expand Down Expand Up @@ -216,7 +217,40 @@
</div>

{tx.data.amount.map((amt, index) => {
const metadata = metadatas?.metadatas.find(m => m.base === amt.denom);
const assetInfo = denomToAsset(env.chain, amt.denom);
let metadata = metadatas?.metadatas.find(m => m.base === amt.denom);

if (amt.denom.startsWith('ibc/')) {
if (assetInfo) {
metadata = {
description: assetInfo?.description ?? '',
denom_units:
assetInfo?.denom_units?.map(unit => ({
...unit,
aliases: unit.aliases || [],
})) ?? [],
base: assetInfo?.base ?? '',
display: assetInfo?.display ?? '',
name: assetInfo?.name ?? '',
symbol: assetInfo?.symbol ?? '',
uri: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
uri_hash: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
};
} else {

Check warning on line 239 in components/bank/components/historyBox.tsx

View check run for this annotation

Codecov / codecov/patch

components/bank/components/historyBox.tsx#L224-L239

Added lines #L224 - L239 were not covered by tests
// assetInfo is undefined
metadata = {
description: '',
denom_units: [],
base: '',
display: '',
name: '',
symbol: '',
uri: '',
uri_hash: '',
};

Check warning on line 250 in components/bank/components/historyBox.tsx

View check run for this annotation

Codecov / codecov/patch

components/bank/components/historyBox.tsx#L241-L250

Added lines #L241 - L250 were not covered by tests
}
}
Comment on lines +220 to +252
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Extract IBC metadata handling and add safety checks.

The code has two issues:

  1. Unsafe access to assetInfo properties
  2. Duplicated metadata creation logic

Extract the logic into a utility function:

+const getIbcMetadata = (assetInfo: any) => {
+  if (!assetInfo) {
+    return {
+      description: '',
+      denom_units: [],
+      base: '',
+      display: '',
+      name: '',
+      symbol: '',
+      uri: '',
+      uri_hash: '',
+    };
+  }
+
+  return {
+    description: assetInfo?.description ?? '',
+    denom_units: assetInfo?.denom_units?.map(unit => ({
+      ...unit,
+      aliases: unit.aliases || [],
+    })) ?? [],
+    base: assetInfo?.base ?? '',
+    display: assetInfo?.display ?? '',
+    name: assetInfo?.name ?? '',
+    symbol: assetInfo?.symbol ?? '',
+    uri: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
+    uri_hash: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
+  };
+};

 if (amt.denom.startsWith('ibc/')) {
   const assetInfo = denomToAsset(env.chain, amt.denom);
-  if (assetInfo) {
-    metadata = {
-      description: assetInfo?.description ?? '',
-      denom_units: assetInfo?.denom_units?.map(unit => ({
-        ...unit,
-        aliases: unit.aliases || [],
-      })) ?? [],
-      base: assetInfo?.base ?? '',
-      display: assetInfo?.display ?? '',
-      name: assetInfo?.name ?? '',
-      symbol: assetInfo?.symbol ?? '',
-      uri: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
-      uri_hash: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
-    };
-  } else {
-    metadata = {
-      description: '',
-      denom_units: [],
-      base: '',
-      display: '',
-      name: '',
-      symbol: '',
-      uri: '',
-      uri_hash: '',
-    };
-  }
+  metadata = getIbcMetadata(assetInfo);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const assetInfo = denomToAsset(env.chain, amt.denom);
let metadata = metadatas?.metadatas.find(m => m.base === amt.denom);
if (amt.denom.startsWith('ibc/')) {
if (assetInfo) {
metadata = {
description: assetInfo?.description ?? '',
denom_units:
assetInfo?.denom_units?.map(unit => ({
...unit,
aliases: unit.aliases || [],
})) ?? [],
base: assetInfo?.base ?? '',
display: assetInfo?.display ?? '',
name: assetInfo?.name ?? '',
symbol: assetInfo?.symbol ?? '',
uri: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
uri_hash: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
};
} else {
// assetInfo is undefined
metadata = {
description: '',
denom_units: [],
base: '',
display: '',
name: '',
symbol: '',
uri: '',
uri_hash: '',
};
}
}
const getIbcMetadata = (assetInfo: any) => {
if (!assetInfo) {
return {
description: '',
denom_units: [],
base: '',
display: '',
name: '',
symbol: '',
uri: '',
uri_hash: '',
};
}
return {
description: assetInfo?.description ?? '',
denom_units: assetInfo?.denom_units?.map(unit => ({
...unit,
aliases: unit.aliases || [],
})) ?? [],
base: assetInfo?.base ?? '',
display: assetInfo?.display ?? '',
name: assetInfo?.name ?? '',
symbol: assetInfo?.symbol ?? '',
uri: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
uri_hash: assetInfo?.logo_URIs?.svg ?? assetInfo?.logo_URIs?.png ?? '',
};
};
const assetInfo = denomToAsset(env.chain, amt.denom);
let metadata = metadatas?.metadatas.find(m => m.base === amt.denom);
if (amt.denom.startsWith('ibc/')) {
metadata = getIbcMetadata(assetInfo);
}


return <DenomImage key={index} denom={metadata} />;
})}

Expand All @@ -228,8 +262,18 @@
<p className="font-semibold text-[#161616] dark:text-white">
{tx.data.amount.map((amt, index) => {
const metadata = metadatas?.metadatas.find(m => m.base === amt.denom);
const display = metadata?.display ?? metadata?.symbol ?? '';
return metadata?.display.startsWith('factory')
let display = metadata?.display ?? metadata?.symbol ?? '';

if (amt.denom.startsWith('ibc/')) {
const assetInfo = denomToAsset(env.chain, amt.denom);
if (assetInfo?.traces && assetInfo.traces.length > 0) {
if (assetInfo.traces[0].counterparty?.base_denom) {
display = assetInfo.traces[0].counterparty.base_denom.slice(1);
}
}

Check warning on line 273 in components/bank/components/historyBox.tsx

View check run for this annotation

Codecov / codecov/patch

components/bank/components/historyBox.tsx#L268-L273

Added lines #L268 - L273 were not covered by tests
}

return metadata?.display?.startsWith('factory')
? metadata?.display?.split('/').pop()?.toUpperCase()
: display.length > 4
? display.slice(0, 4).toUpperCase() + '...'
Expand Down Expand Up @@ -269,7 +313,18 @@
const metadata = metadatas?.metadatas.find(m => m.base === amt.denom);
const exponent = Number(metadata?.denom_units[1]?.exponent) || 6;
const amount = Number(shiftDigits(amt.amount, -exponent));
return `${formatLargeNumber(amount)} ${formatDenom(amt.denom)}`;
let baseDenom = formatDenom(amt.denom);

if (amt.denom.startsWith('ibc/')) {
const assetInfo = denomToAsset(env.chain, amt.denom);
if (assetInfo?.traces && assetInfo.traces.length > 0) {
if (assetInfo.traces[0].counterparty?.base_denom) {
baseDenom = assetInfo.traces[0].counterparty.base_denom.slice(1);
}
}

Check warning on line 324 in components/bank/components/historyBox.tsx

View check run for this annotation

Codecov / codecov/patch

components/bank/components/historyBox.tsx#L319-L324

Added lines #L319 - L324 were not covered by tests
}

return `${formatLargeNumber(amount)} ${baseDenom.toUpperCase()}`;
})
.join(', ')}
</p>
Expand Down
67 changes: 53 additions & 14 deletions components/bank/components/sendBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { useEffect, useMemo, useState } from 'react';
import SendForm from '../forms/sendForm';
import IbcSendForm from '../forms/ibcSendForm';

import env from '@/config/env';
import { CombinedBalanceInfo } from '@/utils/types';

export interface IbcChain {
Expand All @@ -21,6 +21,10 @@
isGroup,
admin,
refetchProposals,
osmosisBalances,
isOsmosisBalancesLoading,
refetchOsmosisBalances,
resolveOsmosisRefetch,
}: {
address: string;
balances: CombinedBalanceInfo[];
Expand All @@ -31,17 +35,43 @@
selectedDenom?: string;
isGroup?: boolean;
admin?: string;
osmosisBalances: CombinedBalanceInfo[];
isOsmosisBalancesLoading: boolean;
refetchOsmosisBalances: () => void;
resolveOsmosisRefetch: () => void;
}) {
const [activeTab, setActiveTab] = useState<'send' | 'cross-chain'>('send');
const [selectedChain, setSelectedChain] = useState('');
const ibcChains: IbcChain[] = [
{
id: 'osmosis',
name: 'Osmosis',
icon: 'https://osmosis.zone/assets/icons/osmo-logo-icon.svg',
prefix: 'osmo',
},
];
const [selectedFromChain, setSelectedFromChain] = useState('');
const [selectedToChain, setSelectedToChain] = useState('');
const ibcChains = useMemo<IbcChain[]>(
() => [
{
id: env.chain,
name: 'Manifest',
icon: 'logo.svg',
prefix: 'manifest',
},
{
id: env.osmosisChain,
name: 'Osmosis',
icon: 'osmosis.svg',
prefix: 'osmo',
},
],
[]
);

useEffect(() => {
if (selectedFromChain && selectedToChain && selectedFromChain === selectedToChain) {
// If chains match, switch the destination chain to the other available chain
const otherChain = ibcChains.find(chain => chain.id !== selectedFromChain)?.id || '';
setSelectedToChain(otherChain);

Check warning on line 68 in components/bank/components/sendBox.tsx

View check run for this annotation

Codecov / codecov/patch

components/bank/components/sendBox.tsx#L67-L68

Added lines #L67 - L68 were not covered by tests
}
}, [selectedFromChain, selectedToChain, ibcChains]);

const getAvailableToChains = useMemo(() => {
return ibcChains.filter(chain => chain.id !== selectedFromChain);
}, [ibcChains, selectedFromChain]);

return (
<div className="rounded-2xl w-full ">
Expand Down Expand Up @@ -79,16 +109,25 @@
<IbcSendForm
isIbcTransfer={true}
ibcChains={ibcChains}
selectedChain={selectedChain}
setSelectedChain={setSelectedChain}
selectedFromChain={selectedFromChain}
setSelectedFromChain={setSelectedFromChain}
selectedToChain={selectedToChain}
setSelectedToChain={setSelectedToChain}
address={address}
destinationChain={selectedChain}
destinationChain={selectedToChain}
balances={balances}
isBalancesLoading={isBalancesLoading}
refetchBalances={refetchBalances}
refetchHistory={refetchHistory}
selectedDenom={selectedDenom}
osmosisBalances={osmosisBalances}
isGroup={isGroup}
admin={admin}
refetchProposals={refetchProposals}
isOsmosisBalancesLoading={isOsmosisBalancesLoading}
refetchOsmosisBalances={refetchOsmosisBalances}
resolveOsmosisRefetch={resolveOsmosisRefetch}
availableToChains={getAvailableToChains}
/>
) : (
<SendForm
Expand Down
25 changes: 22 additions & 3 deletions components/bank/components/tokenList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ interface TokenListProps {
admin?: string;
refetchProposals?: () => void;
searchTerm?: string;
osmosisBalances?: CombinedBalanceInfo[] | undefined;
isOsmosisBalancesLoading?: boolean;
refetchOsmosisBalances?: () => void;
resolveOsmosisRefetch?: () => void;
}

export function TokenList(props: Readonly<TokenListProps>) {
Expand All @@ -30,6 +34,10 @@ export function TokenList(props: Readonly<TokenListProps>) {
admin,
refetchProposals,
searchTerm = '',
osmosisBalances,
isOsmosisBalancesLoading,
refetchOsmosisBalances,
resolveOsmosisRefetch,
} = props;
const [selectedDenom, setSelectedDenom] = useState<any>(null);
const [isSendModalOpen, setIsSendModalOpen] = useState(false);
Expand Down Expand Up @@ -107,9 +115,16 @@ export function TokenList(props: Readonly<TokenListProps>) {
<div className=" flex items-center justify-center">
<DenomImage denom={balance.metadata} />
</div>
<p className="font-semibold text-[#161616] dark:text-white">
{truncateString(balance.metadata?.display ?? '', 12).toUpperCase()}
</p>
<div>
<p className="font-semibold text-[#161616] dark:text-white">
{truncateString(balance.metadata?.display ?? '', 12).toUpperCase()}
</p>
<p className="text-sm text-[#00000099] dark:text-[#FFFFFF99]">
{balance.metadata?.denom_units[0]?.denom.startsWith('ibc')
? balance.metadata?.denom_units[0]?.aliases[0]
: balance.metadata?.denom_units[0]?.denom.split('/').pop()}
</p>
</div>
</div>
<div className="text-center hidden sm:block md:block lg:hidden xl:block">
<p className="font-semibold text-[#161616] dark:text-white">
Expand Down Expand Up @@ -233,6 +248,10 @@ export function TokenList(props: Readonly<TokenListProps>) {
isGroup={isGroup}
admin={admin}
refetchProposals={refetchProposals}
osmosisBalances={osmosisBalances ?? []}
isOsmosisBalancesLoading={isOsmosisBalancesLoading ?? false}
refetchOsmosisBalances={refetchOsmosisBalances ?? (() => {})}
resolveOsmosisRefetch={resolveOsmosisRefetch ?? (() => {})}
/>
</div>
);
Expand Down
Loading
Loading