import { getCurrencyList } from "@/api/ecw/currency" //币种列表
const state = {
  currencyList: []
}

const mutations = {
  SET_CURRENCY_LIST: (state, currencyList) => {
    state.currencyList = currencyList
  }
}

const actions = {
  async loadCurrencyList({ commit }) {
    const response = await getCurrencyList()
    if (!response || !response.data) {
      return
    }
    commit("SET_CURRENCY_LIST", response.data)
  }
}

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