Utility class

Constructors

Properties

Methods

  • Calls the functionName on contractAddress target using the Multicall contract. If the call requires a price update, ERC7412 price update tx is prepended to the tx.

    Parameters

    • contractAddress: `0x${string}`

      Target contract address for the call

    • abi: unknown

      Contract ABI

    • functionName: string

      Function to be called on the contract

    • args: unknown[]

      Arguments list for the function call

    • calls: Call3Value[] = []

      Array of Call3Value calls for Multicall contract

    Returns Promise<unknown>

    Response from the contract function call

  • Decodes the response from a Smart contract function call

    Parameters

    • abi: unknown

      Contract ABI

    • functionName: string

      Function name to decode

    • result: `0x${string}`

      Response from function call that needs to be decoded

    Returns unknown

    Decoded result

  • Determines the type of Error emitted by ERC7412 contract and prepares signed update data

    Parameters

    • data: `0x${string}`

      Error data emitted from ERC7412 contract

    Returns Promise<`0x${string}`>

    Encoded data for oracle price update transaction

  • Fetches off-chain price update data for ERC7412 Oracle contract

    Parameters

    • priceIds: `0x${string}`[]

      Pyth price ids array

    Returns Promise<`0x${string}`[]>

    Pyth Price update data

  • Generates Call3Value tx for Price update data of Oracle

    Parameters

    • oracleContract: `0x${string}`

      Oracle Contract address

    • signedRequiredData: string

      Encoded Price Update data

    Returns Call3Value

    Transaction Request for Oracle price update

  • Returns the Pyth price ids array

    Parameters

    • oracleQueryData: `0x${string}`

    Returns `0x${string}`[]

    Pyth Price IDs array

  • Handles ERC7412 error by creating a price update tx which is prepended to the existing calls

    Parameters

    • error: unknown

      Error thrown by the call function

    • calls: Call3Value[]

      Multicall call data

    Returns Promise<Call3Value[]>

    call array with ERC7412 fulfillOracleQuery transaction

  • Calls the functionName on contractAddress target using the Multicall contract. If the call requires a price update, ERC7412 price update tx is prepended to the tx.

    Parameters

    • contractAddress: `0x${string}`

      Target contract address for the call

    • abi: unknown

      Contract ABI

    • functionName: string

      Function to be called on the contract

    • argsList: unknown[]

      Array of arguments list for the function call

    • calls: Call3Value[] = []

      Array of Call3Value calls for Multicall contract

    Returns Promise<unknown[]>

    Array of responses from the contract function call for the multicalls

  • Calls the functionName on contractAddress target using the Multicall contract. If the call requires a price update, ERC7412 price update tx is prepended to the tx.

    Parameters

    • contractAddress: `0x${string}`

      Target contract address for the call

    • abi: unknown

      Contract ABI

    • functionNames: string[]

      Function to be called on the contract

    • argsList: unknown[]

      Array of arguments list for the function call

    • calls: Call3Value[] = []

      Array of Call3Value calls for Multicall contract

    Returns Promise<unknown[]>

    Array of responses from the contract function call for the multicalls

  • Simulates the functionName on contractAddress target using the Multicall contract and returns the final transaction call with ERC7412 price update data if required

    Parameters

    • OptionalcontractAddress: `0x${string}`

      Target contract address for the call

    • Optionalabi: unknown

      Contract ABI

    • OptionalfunctionName: string

      Function to be called on the contract

    • Optionalargs: unknown[]

      Arguments list for the function call

    • calls: Call3Value[] = []

      Array of Call3Value calls for Multicall contract

    Returns Promise<CallParameters>

    Final transaction with ERC7412 tx data (if necessary)