Skip to content

Commit

Permalink
fix: fees (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit authored Oct 10, 2023
1 parent 66260ba commit d1c57b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions components/Wallet/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ const Wallet = () => {
const chainInfos = await walletWindowConnection.getChainInfosWithoutEndpoints();
return chainInfos.map((chain: { chainId: string }) => chain.chainId);
};

const filterChains = async () => {
const addedChains = await getAddedStationChainsIds();
const filteredChains = chains.filter((chain) => addedChains.includes(chain.chainId) && WALLET_CHAIN_NAMES_BY_CHAIN_ID[chain.chainId]);
const chainNames = filteredChains.map((chain) => WALLET_CHAIN_NAMES_BY_CHAIN_ID[chain.chainId]);
return [chainNames, filteredChains.map((chain) => chain.chainId)];
};

filterChains().then(async ([chainNames, ids]) => {
if (chainNames.includes('injective')) {
try {
Expand All @@ -92,11 +90,11 @@ const Wallet = () => {
if (injIndex !== -1) {
chainNames.splice(injIndex, 1);
ids.splice(injIndex, 1);
setCurrentConnectedChainIds(ids);
}
}
}
setWalletChains(chainNames);
setCurrentConnectedChainIds(ids);
});
} else if (walletChains.length === 0) {
setCurrentConnectedChainIds(Object.values(ACTIVE_NETWORKS[currentChainState.network]))
Expand All @@ -105,7 +103,6 @@ const Wallet = () => {
setCurrentConnectedChainIds(Object.values(ACTIVE_NETWORKS[currentChainState.network]))
}
}, [chains, currentChainState.network, chainName, window.localStorage.getItem(COSMOS_KIT_WALLET_KEY)])

const allChains = useChains(walletChains)
const router = useRouter()

Expand Down
2 changes: 1 addition & 1 deletion constants/signerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const prices = (chainName:string, chain:Chain) => {
if (activeChains.includes(chainName)) {
const [feeTokens] = chain.fees.fee_tokens;
const price = feeTokens
? feeTokens.fixed_min_gas_price || feeTokens.low_gas_price || feeTokens.average_gas_price || 0
? feeTokens.average_gas_price || feeTokens.low_gas_price || feeTokens.fixed_min_gas_price || 0
: 0;
return {
gasPrice: GasPrice.fromString(String(price) + chain.fees.fee_tokens[0].denom),
Expand Down

0 comments on commit d1c57b6

Please sign in to comment.