This guide does not cover setting up the Inverter Network SDK. Please refer to the dedicated pages for the React SDK or TypeScript SDK for guidance.
Retrieving the workflow
The guide for retrieving a
import { Inverter, RequestedModules } from'@inverter-network/sdk'constsdk=Inverter.getInstance({ publicClient, walletClient })const { getDeploy } = sdk// Should either be `as const` or be passed dirrectly in the `run` or `simulate` function argsconstrequestedModules= { fundingManager:'FM_DepositVault_v1', paymentProcessor:'PP_Simple_v1', authorizer:'AUT_Roles_v1', optionalModules: ['LM_PC_Bounties_v1' ]} asconstsatisfiesRequestedModulesconstworkflow=awaitsdk.getWorkflow({ orchestratorAddress:'0x8a1897E6Fa0236F68f86240C391D2a7bED3Cf85c', requestedModules})
Fetch Role Hexes
To begin with the process we need the role hexes from the authorizer.
For admin roles we need to use the granteRole or revokeRole function from the authorizer.
For the granting or revoking we are using the non generated role.
constargs= [ adminRole,walletClient.account.address,] asconst// Grant roleconsttxHash=awaitworkflow.authorizer.write.grantRole.run(args)// Revoke roleconsttxHash=awaitworkflow.authorizer.write.revokeRole.run(args)
Module Role
For any role which is not a orchestrator admin role we need to generate a role id using the authorizer this generation is necessary to have a unique identifier since every workflow has different modules with different addresses.
Generate Role
Note that this is only to check the status of a module role.