LongPort OpenAPI SDK

    Class Config

    Configuration for LongPort sdk

    Index

    Constructors

    Methods

    • Create a new Config from the given environment variables

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

      Variables

      • LONGPORT_LANGUAGE - Language identifier, zh-CN, zh-HK or en (Default: en)
      • LONGPORT_APP_KEY - App key
      • LONGPORT_APP_SECRET - App secret
      • LONGPORT_ACCESS_TOKEN - Access token
      • LONGPORT_HTTP_URL - HTTP endpoint url
      • LONGPORT_QUOTE_WS_URL - Quote websocket endpoint url
      • LONGPORT_TRADE_WS_URL - Trade websocket endpoint url
      • LONGPORT_ENABLE_OVERNIGHT - Enable overnight quote, true or false (Default: false)
      • LONGPORT_PUSH_CANDLESTICK_MODE - realtime or confirmed (Default: realtime)
      • LONGPORT_PRINT_QUOTE_PACKAGES - Print quote packages when connected, true or false (Default: true)

      Returns Config

    • Gets a new access_token

      expired_at - The expiration time of the access token, defaults to 90 days.

      Parameters

      • OptionalexpiredAt: Date

      Returns Promise<string>

    MMNEPVFCICPMFPCPTTAAATR