This repository has been archived by the owner on May 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix role assignment, add
parseRoles
utility
- Loading branch information
Showing
6 changed files
with
126 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { providers, Wallet } from 'ethers'; | ||
import { ColonyRole } from '@colony/colony-js'; | ||
|
||
import { ColonyNetwork, ColonyRpcEndpoint } from '../../src'; | ||
|
||
const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis); | ||
|
||
if (!process.env.PRIVATE_KEY) { | ||
throw new Error( | ||
`Please provide a valid private key as an environment variable: PRIVATE_KEY`, | ||
); | ||
} | ||
|
||
const signer = new Wallet(process.env.PRIVATE_KEY as string).connect(provider); | ||
|
||
// Set the Administration and Funding permissions for the OneTxPayment extension of a Colony | ||
const start = async () => { | ||
const colonyNetwork = await ColonyNetwork.init(signer); | ||
const colony = await colonyNetwork.getColony( | ||
'0xA6fD5655c1249f1349D0917E732813Ebd9439A54', | ||
); | ||
// await colony | ||
// .setRoles('0xA75b108808584A15ceEbF8f6CAc19EaD91cAbCd2', [ | ||
// ColonyRole.Administration, | ||
// ColonyRole.Funding, | ||
// ]) | ||
// .tx(); | ||
const roles = await colony.getRoles( | ||
'0xA75b108808584A15ceEbF8f6CAc19EaD91cAbCd2', | ||
); | ||
console.info( | ||
'Roles', | ||
roles.map((role) => ColonyRole[role]), | ||
); | ||
}; | ||
|
||
start(); |
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