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:

({
    publicClient: PublicClient,
    walletClient?: WalletClient
})

Returns: Inverter instance

{
  publicClient: PublicClient
  walletClient: WalletClient
  
  updatePublicClient: (publicClient: PopPublicClient) => void
  updateWalletClient: (walletClient: PopWalletClient) => void

  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 = new Inverter({
    publicClient,
    walletClient
})

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

Last updated