@toruslabs/fnd-base
Version:
Contains details for sapphire nodes
16 lines (13 loc) • 672 B
JavaScript
import { TORUS_SAPPHIRE_NETWORK, TORUS_LEGACY_NETWORK, LEGACY_NETWORKS_ROUTE_MAP } from '@toruslabs/constants';
import { getSapphireNodeDetails } from './sapphireNetworkConfig.js';
function fetchLocalConfig(network, keyType, sigType) {
if (Object.values(TORUS_SAPPHIRE_NETWORK).includes(network)) {
return getSapphireNodeDetails(network, undefined, keyType, sigType);
}
if (Object.values(TORUS_LEGACY_NETWORK).includes(network)) {
const legacyMap = LEGACY_NETWORKS_ROUTE_MAP[network];
if (legacyMap.migrationCompleted) return getSapphireNodeDetails(legacyMap.networkMigratedTo, network, keyType);
}
return undefined;
}
export { fetchLocalConfig };