import { getChainId } from '@/api/demoMETAMASK'

const state = {
    chainId: '',
    rpc: '',
}


const mutations = {
    SET_CHAIN_ID(state, chainId){
        state.chainId = chainId;
    },
    SET_RPC(state, rpc){
        state.rpc = rpc;
    }
}


const actions = {
  getNetworkInfo({commit, state,}){
    getChainId().then((chainId) => {
        commit('SET_CHAIN_ID', chainId)
    })
  }
}


export default {
    namespaced: true,
    state,
    mutations,
    actions
  }