// @flow
import type { CardanoExplorerResponse } from '../types';
import { externalRequest } from '../../utils/externalRequest';
import { getNetworkExplorerUri } from '../../../utils/network';

const { NETWORK, MAINNET } = global.environment;
const hostname = getNetworkExplorerUri(NETWORK);
const protocol = NETWORK === MAINNET ? 'https' : 'http';

export const getCurrentEpoch = (): Promise<CardanoExplorerResponse> =>
  externalRequest({
    hostname,
    path: '/api/blocks/pages',
    method: 'GET',
    protocol,
  });

// @flow
import type { CardanoExplorerResponse } from '../types';
import { externalRequest } from '../../utils/externalRequest';
import { getNetworkExplorerUri } from '../../../utils/network';

const { isStaging, isTestnet, NETWORK } = global.environment;
const hostname = getNetworkExplorerUri(NETWORK);
const protocol = isStaging || isTestnet ? 'http' : 'https';

export const getCurrentEpoch = (): Promise<CardanoExplorerResponse> =>
  externalRequest({
    hostname,
    path: '/api/blocks/pages',
    method: 'GET',
    protocol,
  });

Fix development fallback epoch call
[DDW-589] Fix development fallback epoch call
