<commit_before>import url from 'url';
import web3 from 'web3';
import MEWProvider from '@/utils/web3-provider';
import WALLET_TYPES from '@/modules/access-wallet/common/walletTypes';
import { formatters } from 'web3-core-helpers';
import EventNames from '@/utils/web3-provider/events';
import { EventBus } from '@/core/plugins/eventBus';
const removeWallet = function ({ commit, state }) {
  if (
    state.identifier === WALLET_TYPES.WALLET_CONNECT ||
    state.identifier === WALLET_TYPES.WALLET_LINK ||
    state.identifier === WALLET_TYPES.MEW_CONNECT
  ) {
    let connection = state.instance.getConnection()
    if (connection) {
      connection.disconnect();
    }
  }
  commit('REMOVE_WALLET');
};

const setWallet = function ({ commit, dispatch }, params) {
  commit('SET_WALLET', params[0]);
  dispatch('setWeb3Instance', params[1]);
};
const setTokens = function ({ commit }, params) {
  commit('SET_TOKENS', params);
};

const setAccountBalance = function ({ commit }, balance) {
  commit('SET_BALANCE', balance);
};

const setWeb3Instance = function (
  { commit, state, rootState, rootGetters },
  provider
) {
  const hostUrl = rootState.global.currentNetwork.url
    ? url.parse(rootState.global.currentNetwork.url)
    : rootGetters['global/Networks']['ETH'][0];
  const options = {};
  // eslint-disable-next-line<commit_msg>Update actions.js<commit_after>import url from 'url';
import web3 from 'web3';
import MEWProvider from '@/utils/web3-provider';
import WALLET_TYPES from '@/modules/access-wallet/common/walletTypes';
import { formatters } from 'web3-core-helpers';
import EventNames from '@/utils/web3-provider/events';
import { EventBus } from '@/core/plugins/eventBus';
const removeWallet = function ({ commit, state }) {
  if (
    state.identifier === WALLET_TYPES.WALLET_CONNECT ||
    state.identifier === WALLET_TYPES.WALLET_LINK ||
    state.identifier === WALLET_TYPES.MEW_CONNECT
  ) {
    const connection = state.instance.getConnection()
    if (connection) {
      connection.disconnect();
    }
  }
  commit('REMOVE_WALLET');
};

const setWallet = function ({ commit, dispatch }, params) {
  commit('SET_WALLET', params[0]);
  dispatch('setWeb3Instance', params[1]);
};
const setTokens = function ({ commit }, params) {
  commit('SET_TOKENS', params);
};

const setAccountBalance = function ({ commit }, balance) {
  commit('SET_BALANCE', balance);
};

const setWeb3Instance = function (
  { commit, state, rootState, rootGetters },
  provider
) {
  const hostUrl = rootState.global.currentNetwork.url
    ? url.parse(rootState.global.currentNetwork.url)
    : rootGetters['global/Networks']['ETH'][0];
  const options = {};
  // eslint-disable-next-line
{'fraction_non_alphanumeric': 0.1473645137342242, 'fraction_numerical': 0.007423904974016332, 'mean_word_length': 4.579710144927536, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3846266', 'n_tokens_mistral': 844, 'n_tokens_neox': 869, 'n_words': 174}