Set up Inverter Network SDK: Refer to the Quick Start Guide for detailed instructions.
Deploying the Workflow
All we have to do is decide on the requestedModules retrieve the runDeployment mutation and fill in the typesafe arg then we can run the mutation in our UI.
'use client'
import { useDeployWorkflow } from '@inverter-network/react/client'
import type {
RequestedModules,
GetDeployWorkflowArgs,
} from '@inverter-network/sdk'
import { Button } from '@inverter-network/react'
import { useWalletClient } from 'wagmi'
export default function Page() {
const walletClientQuery = useWalletClient()
// Defined the modules to be deployed in typesafe manner
const requestedModules = {
fundingManager: 'FM_DepositVault_v1',
paymentProcessor: 'PP_Simple_v1',
authorizer: 'AUT_Roles_v1',
optionalModules: ['LM_PC_Bounties_v1'],
} as const satisfies RequestedModules
const { runDeployment } = useDeployWorkflow({ requestedModules })
// Define the args for the modules in typesafe manner
const args = {
fundingManager: {
orchestratorTokenAddress: '<your_funding_token_address>' as `0x${string}`,
},
authorizer: {
initialAdmin: walletClientQuery.data?.account.address!,
},
} as const satisfies GetDeployWorkflowArgs<typeof requestedModules>
// Return a simple ui to trigger the flow
return (
<form
className="w-screen h-screen flex flex-col items-center justify-center gap-3"
onSubmit={(e) => {
e.preventDefault()
runDeployment.mutate(args)
}}
>
<h1>Orchestrator Address: {runDeployment.data?.orchestratorAddress}</h1>
<h1>Transaction Hash: {runDeployment.data?.transactionHash}</h1>
<Button type="submit" loading={runDeployment.isPending}>
Deploy
</Button>
</form>
)
}