Skip to content

Commit

Permalink
fix: apply queries changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian authored and fbwoolf committed May 25, 2024
1 parent 00459bd commit 33bb19a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/query/src/bitcoin/runes/runes-ticker-info.query.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { isDefined } from '@leather-wallet/utils';
import { useQueries } from '@tanstack/react-query';

import { useConfigRunesEnabled } from '../../common/remote-config/remote-config.query';
import { useLeatherNetwork } from '../../leather-query-provider';
import { RuneBalance, type RuneTickerInfo, useBitcoinClient } from '../bitcoin-client';
import { useRunesEnabled } from './runes.hooks';
import { createRuneCryptoAssetDetails } from './runes.utils';

const queryOptions = { staleTime: 5 * 60 * 1000 };

export function useGetRunesTickerInfoQuery(runesBalances: RuneBalance[]) {
const client = useBitcoinClient();
const network = useLeatherNetwork();
const runesEnabled = useConfigRunesEnabled();
const runesEnabled = useRunesEnabled();

return useQueries({
queries: runesBalances.map(runeBalance => {
return {
enabled:
!runeBalance && (network.chain.bitcoin.bitcoinNetwork === 'testnet' || runesEnabled),
enabled: isDefined(runeBalance) && runesEnabled,
queryKey: ['runes-ticker-info', runeBalance.rune_name],
queryFn: () =>
client.BestinSlotApi.getRunesTickerInfo(
Expand Down

0 comments on commit 33bb19a

Please sign in to comment.