type Network = {
    chainId: string
    label: string
    value: string
    logo: string
    prefix: number
    decimals: number
}

export const networks: Network[] = [
    {
        chainId: "0x475e48fab52f3d0587b6b03101d224560c549e984d1dee197b7d8b55830e7da3",
        value: "casper_staging_testnet",
        label: "CASPER",
        logo: "https://cryptologos.cc/logos/ghostchain-logo.svg",
        prefix: 1996,
        decimals: 18,
    }
]

export const wellKnownGenesisHashByChainId: Record<string, string> =
    networks.reduce((wellKnownChainIds, { chainId, value }) => {
        wellKnownChainIds[value] = chainId
        return wellKnownChainIds
    }, {})

export const wellKnownChainIdByGenesisHash: Record<string, string> =
    networks.reduce((wellKnownChainName, { chainId, value }) => {
        wellKnownChainName[chainId] = value
        return wellKnownChainName
    }, {})

export const wellKnownPrefixByGenesisHash: Record<string, number> =
    networks.reduce((wellKnownPrefixes, { chainId, prefix }) => {
        wellKnownPrefixes[chainId] = prefix
        return wellKnownPrefixes
    }, {})

export const wellKnownDecimalsByGenesisHash: Record<string, number> =
    networks.reduce((wellKnownDecimals, { decimals, chainId }) => {
        wellKnownDecimals[chainId] = decimals
        return wellKnownDecimals
    }, {})

export const CHANNEL_ID = "ghost-extension"
