StaticbuildBuild an OAuth 2.0 client.
If a valid token is already cached on disk
(~/.longbridge/openapi/tokens/<clientId>) it is reused; otherwise
the browser authorization flow is started and onOpenUrl is called
with the authorization URL.
OAuth 2.0 client ID from the Longbridge developer portal
Called with the authorization URL; open it in a browser or print it however you like
OptionalcallbackPort: number | nullTCP port for the local callback server (default: 60355). Must match one of the redirect URIs registered for the client.
OAuth handle that can be passed to Config.fromOAuth or
HttpClient.fromOAuth
OAuth 2.0 client handle for Longbridge OpenAPI
Obtain an instance via
OAuth.build(...). Pass it toConfig.fromOAuth(...)orHttpClient.fromOAuth(...).Example