-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add IVotingReputationClientV12
- Loading branch information
Showing
10 changed files
with
88 additions
and
57 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
packages/colony-js/src/clients/Extensions/VotingReputation/VotingReputationClientV12.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { AugmentedIColony } from '../../Core/augments/commonAugments.js'; | ||
import type { IVotingReputation } from '../../../contracts/IVotingReputation/12/IVotingReputation.js'; | ||
|
||
import { IVotingReputation__factory as VotingReputationFactory } from '../../../contracts/IVotingReputation/12/factories/IVotingReputation__factory.js'; | ||
import { ClientType } from '../../../constants.js'; | ||
import { | ||
AugmentedEstimate, | ||
AugmentedVotingReputation, | ||
} from './augments/commonAugments.js'; | ||
import { AugmentedEstimateV2, AugmentsV2 } from './augments/augmentsV2.js'; | ||
import { | ||
addAugments as addAugmentsV3, | ||
AugmentedEstimateV3, | ||
AugmentsV3, | ||
} from './augments/augmentsV3.js'; | ||
|
||
interface VotingReputationEstimate | ||
extends AugmentedEstimate<IVotingReputation>, | ||
AugmentedEstimateV2, | ||
AugmentedEstimateV3 {} | ||
|
||
export interface VotingReputationClientV12 | ||
extends AugmentedVotingReputation<IVotingReputation>, | ||
AugmentsV2<IVotingReputation>, | ||
AugmentsV3<IVotingReputation> { | ||
clientVersion: 12; | ||
estimateGas: VotingReputationEstimate; | ||
} | ||
|
||
export default function getVotingReputationClient( | ||
colonyClient: AugmentedIColony, | ||
address: string, | ||
): VotingReputationClientV12 { | ||
const votingReputationClient = VotingReputationFactory.connect( | ||
address, | ||
colonyClient.signer || colonyClient.provider, | ||
) as VotingReputationClientV12; | ||
|
||
votingReputationClient.clientType = ClientType.VotingReputationClient; | ||
votingReputationClient.clientVersion = 12; | ||
|
||
addAugmentsV3(votingReputationClient, colonyClient); | ||
|
||
return votingReputationClient; | ||
} |
35 changes: 5 additions & 30 deletions
35
packages/colony-js/src/clients/Extensions/VotingReputation/VotingReputationClientV6.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.