Hierarchy (View Summary)

Constructors

  • Parameters

    • url: string

      Url for middleware API

    • options: MiddlewareOptionalParams & {
          ignoreVersion?: boolean;
          retryCount?: number;
          retryOverallDelay?: number;
      } = {}

      Options

      • OptionalignoreVersion?: boolean

        Print warning instead of throwing exception if middleware is not supported, use with caution

      • OptionalretryCount?: number

        Amount of extra requests to do in case of failure

      • OptionalretryOverallDelay?: number

        Time in ms to wait between all retries

    Returns Middleware

Properties

$host: string

Methods

  • Get a single name.

    Parameters

    • id: `${string}.chain` | `nm_${string}`

      The name

    • Optionaloptions: GetNameOptionalParams

      The options parameters.

    Returns Promise<Name>

  • Get a middleware response by path instead of a method name and arguments.

    Type Parameters

    • Response = unknown

    Parameters

    • pathWithQuery: string

      a path to request starting with /v3/

    Returns Promise<Response>

  • Send an HTTP request that is populated using the provided OperationSpec.

    Type Parameters

    • T

      The typed result of the request, based on the OperationSpec.

    Parameters

    • operationArguments: OperationArguments

      The arguments that the HTTP request's templated values will be populated from.

    • operationSpec: OperationSpec

      The OperationSpec to use to populate the httpRequest.

    Returns Promise<T>