Skip to main content

Index

Constructors

constructor

  • new FunctionRunner(verifyingContract?: string, enclaveWallet?: Wallet, chainId?: number): FunctionRunner
  • Parameters

    • optionalverifyingContract: string
    • optionalenclaveWallet: Wallet
    • optionalchainId: number

    Returns FunctionRunner

Properties

publicreadonlycallIds

callIds: string[]

readonlychainId

chainId: number

readonlyenclaveWallet

enclaveWallet: Wallet

publicreadonlyfunctionId

functionId: string

publicreadonlyrawParams

rawParams: string[]

publicreadonlyverifyingContract

verifyingContract: string

Methods

emit

  • emit(populatedTxn: PopulatedTransaction[], callIds?: string[], expirationTimeSeconds?: number, gasLimit?: string): Promise<void>
  • @example
    const runner = new FunctionRunner();
    const txns = await runner.emit(
    [contractFunctonTx1, contractFunctonTx2],
    [] // defaults to handling all call ids
    Math.floor(Date.now() / 1000) + 60, // 60 seconds from run time
    1_000_000 // 1 million gas limit,
    );

    Parameters

    • populatedTxn: PopulatedTransaction[]

      An array of ethers PopulatedTransaction

    • optionalcallIds: string[]

      An array of callIds to handle (defaults to all callIds / none if no params)

    • optionalexpirationTimeSeconds: number

      The expiration time in seconds

    • optionalgasLimit: string

      The gas limit for the transaction

    Returns Promise<void>

params

  • params(paramType: readonly any[]): { callId: string; params: any }[]
  • @example
    const runner = new FunctionRunner();
    const params = runner.params(["uint256", "uint256"]);
    console.log(params);
    // [
    // {
    // callId: "0x000000
    // params: [BigNumber(1), BigNumber(2)]
    // },
    // {
    // callId: "0x000000
    // params: [BigNumber(3), BigNumber(4)]
    // }
    // ]

    Parameters

    • paramType: readonly any[]

      An array of strings or ethers ParamTypes

    Returns { callId: string; params: any }[]