20 lines
689 B
JavaScript
20 lines
689 B
JavaScript
import { constants } from '../utils/constants'
|
|
import helpers from './helpers'
|
|
|
|
export default class KeysManager {
|
|
async init({ web3, netId, addresses }) {
|
|
const { KEYS_MANAGER_ADDRESS } = addresses
|
|
console.log('Keys Manager address ', KEYS_MANAGER_ADDRESS)
|
|
|
|
const KeysManagerAbi = await helpers.getABI(constants.NETWORKS[netId].BRANCH, 'KeysManager')
|
|
|
|
this.instance = new web3.eth.Contract(KeysManagerAbi, KEYS_MANAGER_ADDRESS)
|
|
}
|
|
async miningKeyByVoting(votingKey) {
|
|
return await this.instance.methods.miningKeyByVoting(votingKey).call()
|
|
}
|
|
async getVotingByMining(miningKey) {
|
|
return await this.instance.methods.getVotingByMining(miningKey).call()
|
|
}
|
|
}
|