resolve dependency & findEvent conflicts

This commit is contained in:
gozzy 2022-09-09 03:36:14 +00:00
parent af4b51ca5b
commit 7d340f715d
3 changed files with 17 additions and 10 deletions

View file

@ -1,18 +1,20 @@
import Web3 from 'web3'
import graph from '@/services/graph'
import { download } from '@/store/snark'
import networkConfig from '@/networkConfig'
import InstanceABI from '@/abis/Instance.abi.json'
import { CONTRACT_INSTANCES, eventsType } from '@/constants'
import { sleep, formatEvents, capitalizeFirstLetter } from '@/utils'
const supportedNetworkCaches = [ '1', '56', '100', '137' ]
const supportedCaches = ['1', '56', '100', '137']
class EventService {
constructor({ netId, amount, currency, factoryMethods }) {
this.idb = window.$nuxt.$indexedDB(netId)
const { nativeCurrency } = networkConfig[`netId${netId}`]
const hasCache = supportedCaches.indexOf(Number(this.netId)) !== 0
this.netId = netId
this.amount = amount
@ -22,8 +24,7 @@ class EventService {
this.contract = this.getContract({ netId, amount, currency })
this.isNative = nativeCurrency === this.currency
this.hasCache = this.isNative
&& supportedNetworkCaches.indexOf(this.netId) !== 0
this.hasCache = this.isNative && hasCache
}
getInstanceName(type) {