Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PropertiesAggregatorService<T>

PropertiesAggregatorService allows queries of a contract's methods to be aggregated into one call, with the limitation that none of the methods can have arguments. Method names are dynamically provided in order to provide flexibility for easily adding or removing property queries in the future

Type parameters

Hierarchy

  • ContractService<T>
    • PropertiesAggregatorService

Index

Constructors

Properties

addressProvider: AddressProvider<T>
chainId: 1 | 10 | 250 | 1337 | 42161
ctx: Context
events: Emittery<Record<string, unknown>, Record<string, unknown> & OmnipresentEventData, never>
abi: string[] = ...
contractId: ContractAddressId = ContractAddressId.propertiesAggregator

Accessors

  • get contract(): Promise<WrappedContract>

Methods

  • _getContract(abi: string[], contractId: ContractAddressId, ctx: Context): Promise<WrappedContract>
  • Parameters

    • abi: string[]
    • contractId: ContractAddressId
    • ctx: Context

    Returns Promise<WrappedContract>

  • getProperties(target: string, paramTypes: ParamType[]): Promise<Record<string, DecodingType>>
  • Simultaneously fetches multiple properties from the target contract, assuming no arguments are used for each property

    Parameters

    • target: string

      The target contract to perform the call on

    • paramTypes: ParamType[]

      An array of Ethers' ParamType object that contains data about the method to call e.g. ParamType.from("string name")

    Returns Promise<Record<string, DecodingType>>

    An object with the inputted property names as keys, and corresponding decoded data as values

  • getProperty(target: string, paramType: ParamType): Promise<DecodingType>
  • Fetches a single property from the target contract, assuming no arguments are used for the property

    Parameters

    • target: string

      The target contract to perform the call on

    • paramType: ParamType

      Ethers' ParamType object that contains data about the method to call e.g. ParamType.from("string name")

    Returns Promise<DecodingType>

    The decoded result of the property query

Generated using TypeDoc