/* * VotingReputation Client Version 1 autogenerated by * @colony/colony-js version 4.0.0-beta.0 from colonyNetwork tag 'clwss' * * Feel free to modify as needed! */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { ClientType } from '../../../../constants'; import { VotingReputation__factory as VotingReputationFactory } from '../../../../contracts/extensions/votingReputation/1/factories/VotingReputation__factory'; import { VotingReputation } from '../../../../contracts/extensions/votingReputation/1/VotingReputation'; import { ExtendedIColony } from '../../../../clients/Colony/extensions/commonExtensions'; import { getVotingReputationClientAddons, getVotingReputationClientEstimateAddons, } from './VotingReputationClientAddons'; type VotingReputationEstimate = VotingReputation['estimate']; interface VotingReputationEstimateWithAddons extends VotingReputationEstimate { /* * @TODO These needs to be specifically determined once we can integrate * static code analysis into this lib */ [key: string]: any; } export interface VotingReputationClient extends VotingReputation { clientType: ClientType.VotingReputationClient; estimate: VotingReputationEstimateWithAddons; /* * @TODO These needs to be specifically determined once we can integrate * static code analysis into this lib */ [key: string]: any; } const getVotingReputationClient = ( address: string, colonyClient: ExtendedIColony, ): VotingReputationClient => { const votingReputationClient = VotingReputationFactory.connect( address, colonyClient.signer || colonyClient.provider, ) as VotingReputationClient; votingReputationClient.clientType = ClientType.VotingReputationClient; const addons = getVotingReputationClientAddons( votingReputationClient, colonyClient, ); const addonsEstimate = getVotingReputationClientEstimateAddons( votingReputationClient, colonyClient, ); Object.keys(addons).map((addonName) => { votingReputationClient[addonName] = addons[addonName]; return null; }); Object.keys(addonsEstimate).map((addonName) => { votingReputationClient.estimate[addonName] = addonsEstimate[addonName]; return null; }); return votingReputationClient; }; export default getVotingReputationClient; /* eslint-enable */