@@ -10,6 +10,7 @@ import { CoinPretty, Dec, PricePretty } from "@keplr-wallet/unit";
1010import { NEUTRON_CHAIN_ID , NOBLE_CHAIN_ID } from "../config.ui" ;
1111import { ModularChainInfo } from "@keplr-wallet/types" ;
1212import { ClaimAllEachState } from "../stores/claim-rewards-state" ;
13+ import { ChainIdHelper } from "@keplr-wallet/cosmos" ;
1314
1415export interface ViewClaimToken extends Omit < ViewToken , "chainInfo" > {
1516 modularChainInfo : ModularChainInfo ;
@@ -85,19 +86,15 @@ export function useRewards() {
8586 } ) ;
8687 }
8788 } else if ( "cosmos" in modularChainInfo ) {
88- const isEVMOnly = chainStore . isEvmOnlyChain ( chainId ) ;
89- if ( isEVMOnly ) {
90- continue ;
91- }
92-
9389 const accountAddress = account . bech32Address ;
94- const chainInfo = chainStore . getChain ( chainId ) ;
9590 const queries = queriesStore . get ( chainId ) ;
9691
9792 if ( chainId === NOBLE_CHAIN_ID ) {
9893 const queryYield =
9994 queries . noble . queryYield . getQueryBech32Address ( accountAddress ) ;
100- const usdnCurrency = chainInfo . findCurrency ( "uusdn" ) || USDN_CURRENCY ;
95+ const usdnCurrency =
96+ chainStore . getModularChainInfoImpl ( chainId ) . findCurrency ( "uusdn" ) ||
97+ USDN_CURRENCY ;
10198 const rawAmount = queryYield . claimableAmount ;
10299 const amount = new CoinPretty ( usdnCurrency , rawAmount ) ;
103100 if ( amount . toDec ( ) . gt ( new Dec ( 0 ) ) ) {
@@ -117,19 +114,24 @@ export function useRewards() {
117114 queries . cosmos . queryRewards . getQueryBech32Address ( accountAddress ) ;
118115
119116 const targetDenom = ( ( ) => {
120- if ( chainInfo . chainIdentifier === "dydx-mainnet" ) {
117+ const chainIdentifier = ChainIdHelper . parse ( chainId ) . identifier ;
118+ if ( chainIdentifier === "dydx-mainnet" ) {
121119 return "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5" ;
122120 }
123121
124- if ( chainInfo . chainIdentifier === "elys" ) {
122+ if ( chainIdentifier === "elys" ) {
125123 return "ueden" ;
126124 }
127125
128- return chainInfo . stakeCurrency ?. coinMinimalDenom ;
126+ return "cosmos" in modularChainInfo
127+ ? modularChainInfo . cosmos . stakeCurrency ?. coinMinimalDenom
128+ : undefined ;
129129 } ) ( ) ;
130130
131131 if ( targetDenom ) {
132- const currency = chainInfo . findCurrency ( targetDenom ) ;
132+ const currency = chainStore
133+ . getModularChainInfoImpl ( chainId )
134+ . findCurrency ( targetDenom ) ;
133135 if ( currency ) {
134136 const reward = queryRewards . rewards . find (
135137 ( r ) => r . currency . coinMinimalDenom === targetDenom
0 commit comments