/*
 * Copyright (c) 2022 @automata-network/wallet-sdk authors and contributors.
 * This software may be modified and distributed under the terms of UNLICENSED
 * license. Refer to the LICENSE file for details.
 */
import { createContext } from 'react'

import { Chains } from '../../core'

export interface ChainContextProps {
  chains: Chains
  chainId?: string
  setChainId: React.Dispatch<React.SetStateAction<string | undefined>>
}

export const ChainContext = createContext<ChainContextProps>({
  chains: [],
  chainId: undefined,
  setChainId: () => {
    throw new Error('connect function must be overriden before use')
  }
})
