Inverter

The Inverter class is the most efficient entry point to the sdk, it provides the main API's with the required param's pre-filled.

Parameters:

Inverter.getInstance({
    publicClient: PublicClient,
    walletClient?: WalletClient
})

Returns: Inverter instance

{
  publicClient: PublicClient
  walletClient: WalletClient

  getWorkflow: ({
    orchestratorAddress: `0x${string}`,
    requestedModules?: WorkflowRequestedModules
  }) => Promise<Workflow>

  getDeployOptions: (factoryType?: FactoryType = 'default') => {
    fundingManager: string[]
    authorizer: string[]
    paymentProcessor: string[]
    optionalModules: string[]
  }

  getDeploy: ({
    requestedModules: RequestedModules,
    factoryType?: FactoryType = 'default',
  }) => {
    inputs: FormattedAbiParameter[],
    run,
    simulate,
    estimateGas
  }
  
  deploy: <K extends DeployKeys>(
    key: K,
    params: Omit<DeployParamsByKey<K>, 'walletClient' | 'publicClient'>
  ) => DeployReturnByKey<K>
  
  getModule: <N extends ModuleName>(
    params: Omit<GetModuleParams<N, W>, 'walletClient' | 'publicClient'>
  ) => GetModuleReturn<N, W>
}

Example:

import { Inverter } from '@inverter-network/sdk'

const sdk = Inverter.getInstance({ publicClient, walletClient })

const { 
    publicClient,
    walletClient,
    updatePublicClient,
    updateWalletClient,
    getWorkflow, 
    getDeployOptions,
    getDeploy,
    getModule,
    deploy
} = sdk

Last updated