@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
19 lines • 689 B
JavaScript
import { ChainType, isBatchingSupported } from '@lifi/sdk';
import { useQuery } from '@tanstack/react-query';
export function useIsBatchingSupported(chain, address) {
const enabled = chain && chain.chainType === ChainType.EVM && !!address;
const { data, isLoading } = useQuery({
queryKey: ['isBatchingSupported', chain?.id, address],
queryFn: () => {
return isBatchingSupported({ chainId: chain.id });
},
enabled,
staleTime: 3600000,
retry: false,
});
return {
isBatchingSupported: data,
isBatchingSupportedLoading: enabled && isLoading,
};
}
//# sourceMappingURL=useIsBatchingSupported.js.map