Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
da5ee34
fix: prevent runtime error by using optional chaining for walletInfo.…
sdqede Jun 23, 2025
6f16e0b
chain-registry 2.0
sdqede Jun 23, 2025
59b6207
modify packageManager from yarn 4.1 to 4.3
sdqede Jun 23, 2025
47e6f77
upgrade chain-registry to 2.0
sdqede Jun 23, 2025
6282a84
fix bugs of building failure
sdqede Jun 23, 2025
3f6e72d
fix Type error: 'Component' cannot be used as a JSX component
sdqede Jun 23, 2025
63d8db3
replaced @chain-registry/v2 with chain-registry v2.0
sdqede Jun 26, 2025
e5e42a0
upgraded interchain-kit
sdqede Jun 26, 2025
34f16a8
fix interchain-kit issue in chain-admin
sdqede Jun 26, 2025
a29efb7
upgraded interchain-kit for hyperweb ui
sdqede Jun 26, 2025
f7d17a0
regenerate lock file
sdqede Jun 26, 2025
e6ff975
solved building issue of chain-admin
sdqede Jun 26, 2025
ad0fc7b
add lock file for templates
sdqede Jun 26, 2025
01ff89f
interchain-kit addChain async
sdqede Jun 30, 2025
c53b8a4
renew prettier config
sdqede Jun 30, 2025
ecfe06a
apply prettier to all modified files
sdqede Jun 30, 2025
5953ba3
fixed some bugs about reading attributes from undefined
sdqede Jun 30, 2025
639ca5c
use the same version of @interchainjs/cosmos and @interchainjs/react
sdqede Jun 30, 2025
bee56c3
removed as any inside createInstantiateContract
sdqede Jun 30, 2025
c65aa78
install packages and regenerate lock file
sdqede Jul 2, 2025
a02c2e8
upgrade interchainjs
sdqede Jul 2, 2025
c548008
fixed some path issue of new interchianjs in the chain-admin
sdqede Jul 2, 2025
2650084
fixed some issue related to building
sdqede Jul 2, 2025
e0843c8
keep using @chain-registry/v2 because @interchainjs/utils peer deppen…
sdqede Jul 2, 2025
a19dbee
fixed issue that asset list show no assets
sdqede Jul 2, 2025
8ec71c6
show icon of hyper token
sdqede Jul 2, 2025
063d99c
Add special handling for Hyperweb chain's native token throughout ass…
sdqede Jul 2, 2025
1b2a0dd
fixed some issue of building
sdqede Jul 2, 2025
5cabe45
fixed signer issue on contract deploying
sdqede Jul 3, 2025
4fa5e69
deploy contract success
sdqede Jul 8, 2025
b9c729f
execute contract success
sdqede Jul 14, 2025
132976e
contract query success
sdqede Jul 14, 2025
bc867db
fixed building issue
sdqede Jul 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
Prev Previous commit
Next Next commit
fixed issue that asset list show no assets
  • Loading branch information
sdqede committed Jul 2, 2025
commit a19dbee2d8af5943af4e41ddf4071e07b7b27ede
2 changes: 1 addition & 1 deletion templates/chain-admin/hooks/asset-list/useAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const useAssets = (chainName: string) => {
const dollarValue = calcCoinDollarValue(prices, { amount, denom });
return {
symbol,
logoUrl: asset.logoURIs?.png || asset.logoURIs?.svg,
logoUrl: asset?.logoURIs?.png || asset?.logoURIs?.svg,
prettyChainName: getPrettyChainName(denom),
displayAmount: convRawToDispAmount(denom, amount),
dollarValue,
Expand Down
27 changes: 21 additions & 6 deletions templates/chain-admin/hooks/asset-list/useChainAssetsPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,27 @@ export const useChainAssetsPrices = (chainName: string) => {
return useQuery({
queryKey: ['useChainAssetsPrices', chainName],
queryFn: () => fetchPrices(geckoIds),
select: (data) => ({
...formatPrices(data, assetsWithGeckoIds),
...(isStarshipChain
? { [allAssets[0].base]: DEFAULT_HYPERWEB_TOKEN_PRICE }
: {}),
}),
select: (data) => {
const formattedPrices = formatPrices(data, assetsWithGeckoIds);

// Always add hyperweb price for hyperweb chain
const hyperwebPrice =
chainName === 'hyperweb'
? { uhyper: DEFAULT_HYPERWEB_TOKEN_PRICE }
: {};

// Also add for starship chains if detected
const starshipPrice =
isStarshipChain && allAssets.length > 0
? { [allAssets[0].base]: DEFAULT_HYPERWEB_TOKEN_PRICE }
: {};

return {
...formattedPrices,
...hyperwebPrice,
...starshipPrice,
};
},
staleTime: Infinity,
});
};
52 changes: 48 additions & 4 deletions templates/chain-admin/hooks/asset-list/useChainUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,34 @@ export const useChainUtils = (chainName: string) => {
};

const getAssetByDenom = (denom: CoinDenom): Asset => {
return allAssets.find((asset) => asset.base === denom) as Asset;
const asset = allAssets.find((asset) => asset.base === denom);

// Fallback for hyperweb native token if not found in asset lists
if (!asset && denom === 'uhyper' && chainName === 'hyperweb') {
Copy link
Contributor

Choose a reason for hiding this comment

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

no hard-coded values

return {
base: 'uhyper',
name: 'Hyperweb',
display: 'hyper',
symbol: 'HYPER',
denomUnits: [
{
denom: 'uhyper',
exponent: 0,
},
{
denom: 'hyper',
exponent: 6,
},
],
logoURIs: {
png: '',
svg: '',
},
typeAsset: 'sdk.coin',
} as unknown as Asset;
}

return asset as Asset;
};

const denomToSymbol = (denom: CoinDenom): CoinSymbol => {
Expand Down Expand Up @@ -77,8 +104,15 @@ export const useChainUtils = (chainName: string) => {
};

const getExponentByDenom = (denom: CoinDenom): Exponent => {
// Special handling for hyperweb native token
if (denom === 'uhyper') {
Copy link
Contributor

Choose a reason for hiding this comment

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

no hard-coded values

return 6;
}

const asset = getAssetByDenom(denom);
const unit = asset?.denomUnits.find(({ denom }) => denom === asset.display);
const unit = asset?.denomUnits?.find(
({ denom }) => denom === asset.display
);
return unit?.exponent || 0;
};

Expand All @@ -98,6 +132,11 @@ export const useChainUtils = (chainName: string) => {
};

const getChainName = (ibcDenom: CoinDenom) => {
// Special handling for hyperweb native token
if (ibcDenom === 'uhyper' && chainName === 'hyperweb') {
Copy link
Contributor

Choose a reason for hiding this comment

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

no hard coded values

return chainName;
}

if (nativeAssets.find((asset) => asset.base === ibcDenom)) {
return chainName;
}
Expand All @@ -109,8 +148,13 @@ export const useChainUtils = (chainName: string) => {
};

const getPrettyChainName = (ibcDenom: CoinDenom) => {
const chainName = getChainName(ibcDenom);
const chain = chains.find((chain) => chain.chainName === chainName);
// Special handling for hyperweb native token
if (ibcDenom === 'uhyper' && chainName === 'hyperweb') {
return 'Hyperweb Devnet';
}

const resolvedChainName = getChainName(ibcDenom);
const chain = chains.find((chain) => chain.chainName === resolvedChainName);
if (!chain) throw Error('chain not found');
return chain.prettyName;
};
Expand Down