Constructors

Methods

Constructors

  • Parameters

    • httpUrl: string
    • appKey: string
    • appSecret: string
    • accessToken: string

    Returns HttpClient

Methods

  • Create a new HttpClient from the given environment variables

    It first gets the environment variables from the .env file in the current directory.

    Variables

    • LONGPORT_HTTP_URL - HTTP endpoint url
    • LONGPORT_APP_KEY - App key
    • LONGPORT_APP_SECRET - App secret
    • LONGPORT_ACCESS_TOKEN - Access token

    Returns HttpClient

  • Performs a HTTP request

    Parameters

    • method: string
    • path: string
    • Optional headers: Record<string, string>
    • Optional body: any

    Returns Promise<any>