Type Alias AutoloadConfig

AutoloadConfig: {
    abiLoader?: ABILoader | false;
    addressResolver?: ((name: string) => Promise<string>);
    enableExperimentalMetadata?: boolean;
    followProxies?: boolean;
    loadContractResult?: boolean;
    onError?: ((phase: string, error: Error) => boolean | void);
    onProgress?: ((phase: string, ...args: any[]) => void);
    provider: AnyProvider;
    signatureLookup?: SignatureLookup | false;
}

AutoloadConfig specifies the configuration inputs for the autoload function.

Type declaration

  • OptionalabiLoader?: ABILoader | false
  • OptionaladdressResolver?: ((name: string) => Promise<string>)

    Called to resolve invalid addresses, uses provider's built-in resolver otherwise

      • (name): Promise<string>
      • Parameters

        • name: string

        Returns Promise<string>

  • Optional ExperimentalenableExperimentalMetadata?: boolean

    Enable pulling additional metadata from WhatsABI's static analysis which may be unreliable. For now, this is primarily for event topics.

  • OptionalfollowProxies?: boolean

    Enable following proxies automagically, if possible. Return the final result. Note that some proxies are relative to a specific selector (such as DiamondProxies), so they will not be followed

  • OptionalloadContractResult?: boolean

    Load full contract metadata result, include it in AutoloadResult.ContractResult if successful.

    This changes the behaviour of autoload to use ABILoader.getContract instead of ABILoader.loadABI, which returns a larger superset result including all of the available verified contract metadata.

  • OptionalonError?: ((phase: string, error: Error) => boolean | void)

    Called during any encountered errors during a given phase

      • (phase, error): boolean | void
      • Parameters

        • phase: string
        • error: Error

        Returns boolean | void

  • OptionalonProgress?: ((phase: string, ...args: any[]) => void)

    Called during various phases: resolveName, getCode, abiLoader, signatureLookup, followProxies

      • (phase, ...args): void
      • Parameters

        • phase: string
        • Rest...args: any[]

        Returns void

  • provider: AnyProvider
  • OptionalsignatureLookup?: SignatureLookup | false