Skip to content

fix: show nam from mainnet instead of housefire #2187

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

Merged
merged 1 commit into from
Jun 20, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion apps/namadillo/src/atoms/integrations/atoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ import {
queryAssetBalances,
} from "./services";

export const mainnetNamDenomOnOsmosis =
"ibc/C7110DEC66869DAE9BE9C3C60F4B5313B16A2204AE020C3B0527DD6B322386A3";

export const housefireNamDenomOnOsmosis =
"ibc/48473B990DD70EC30F270727C4FEBA5D49C7D74949498CDE99113B13F9EA5522";

type IBCTransferAtomParams = {
client: SigningStargateClient;
tx: TxRaw;
Expand Down Expand Up @@ -84,8 +90,20 @@ export const assetBalanceAtomFamily = atomFamily(
...queryDependentFn(async () => {
return await queryAndStoreRpc(chain!, async (rpc: string) => {
const assetsBalances = await queryAssetBalances(walletAddress!, rpc);

// Housefire NAM is still appearing because the function `ibcAddressToDenomTrace`
// calls stargate to get the denom based on the `ibc/...` address, and this is
// returning the NAM, so we can't filter it without a major assets refactoring.
// For now, let's filter it individually while we don't have a good solution
// Some solutions:
// - Check only the registry and ignore dynamic values from stargate
// - Create an allow/blocklist to filter it with more control
const allowedBalances = assetsBalances.filter(
(i) => i.denom !== housefireNamDenomOnOsmosis
);

return await mapCoinsToAssets(
assetsBalances,
allowedBalances,
chain!.chain_id,
ibcAddressToDenomTrace(rpc)
);
Expand Down
10 changes: 0 additions & 10 deletions apps/namadillo/src/atoms/integrations/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import internalDevnetCosmosTestnetIbc from "@namada/chain-registry/_testnets/_IB
// TODO: this causes a big increase on bundle size. See #1224.
import registry from "chain-registry";
import { searchNamadaTestnetByChainId } from "lib/chain";
import { mainnetNamAssetOnOsmosis } from "./temp-assets";

export const namadaTestnetChainList = [
internalDevnetChain,
Expand Down Expand Up @@ -78,15 +77,6 @@ const testnetChains: ChainRegistryEntry[] = [

const mainnetAndTestnetChains = [...mainnetChains, ...testnetChains];

// Terrible hack to inject nam asset in osmosis so we can show them as a token for ibc.
// We should update the chain-registry and later remove this hack!
// Please note that this is only a fix for mainnet nam, not housefire
registry.assets
.find((chain) => chain.chain_name === "osmosis")
?.assets.push(mainnetNamAssetOnOsmosis);
osmosis.assets.assets.push(mainnetNamAssetOnOsmosis);
// End of the hack

export const getKnownChains = (
includeTestnets?: boolean
): ChainRegistryEntry[] => {
Expand Down
93 changes: 0 additions & 93 deletions apps/namadillo/src/atoms/integrations/temp-assets.ts

This file was deleted.