Deploy a Workflow
'use client'
import { useDeployWorklow } from '@inverter-network/react/client'
import type { RequestedModules, GeDeployWorkflowArgs } from '@inverter-network/sdk'
import { Button } from '@inverter-network/react'
export default function Page() {
// 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 } = useDeployWorklow({requestedModules})
// Define the args for the modules in typesafe manner
const args = {
fundingManager: {
orchestratorTokenAddress: <your_funding_token_address>,
},
authorizer: {
initialAdmin: inverter.data?.walletClient.account.address,
}
} as const satisfies GeDeployWorkflowArgs<typeof requestedModules>
// Return a simple ui to trigger the flow
return (
<div className="w-screen h-screen flex flex-col items-center justify-center">
<h1>Orchestrator Address: {runDeployment.data?.orchestratorAddress}</h1>
<h1>Transaction Hash: {runDeployment.data?.transactionHash}</h1>
<Button
onClick={() => { runDeployment.mutate(args) }}
loading={runDeployment.isPending}
>
Deploy
</Button>
</div>
)
}
Last updated