Config
Configuration options for LongPort sdk
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_key
|
str
|
App Key |
required |
app_secret
|
str
|
App Secret |
required |
access_token
|
str
|
Access Token |
required |
http_url
|
Optional[str]
|
HTTP API url |
None
|
trade_ws_url
|
Optional[str]
|
Websocket url for trade API |
None
|
language
|
Optional[Type[Language]]
|
Language identifier |
None
|
__init__
__init__(app_key: str, app_secret: str, access_token: str, http_url: Optional[str] = None, trade_ws_url: Optional[str] = None, language: Optional[Type[Language]] = None) -> None
from_env
classmethod
from_env() -> Config
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_APP_KEY- App keyLONGPORT_APP_SECRET- App secretLONGPORT_ACCESS_TOKEN- Access tokenLONGPORT_HTTP_URL- HTTP endpoint urlLONGPORT_TRADE_WS_URL- Trade websocket endpoint url