- New
assetpackage withStatementContextfor accessing statement APIs:StatementList– list account statements with date range and pagination.StatementDownloadURL– get the download URL for a specific statement file.
- Staging environment support: set
LONGBRIDGE_ENV=stagingto point tolongbridge.xyzendpoints (HTTP, quote WebSocket, trade WebSocket, OAuth). ContentContextadds two new methods:MyTopics(opts *MyTopicsOptions)— get topics created by the current authenticated user, with optional page/size/topic_type filtering.CreateTopic(opts *CreateTopicOptions)— create a new topic; returns the topic ID (string) on success.
- New types:
OwnedTopic,MyTopicsOptions,CreateTopicOptions,TopicReply,TopicAuthor,TopicImage.
- CN endpoint URLs: Migrated from
longportapp.cntolongbridge.cn(HTTP, quote WebSocket, trade WebSocket). - OAuth token storage path: Changed from
~/.longbridge-openapi/tokens/to~/.longbridge/openapi/tokens/. Existing tokens under the old path will not be read automatically; move them manually or re-authorize.
- New
contentpackage withContentContextfor accessing content APIs:Topics– list discussion topics for a symbol.News– list news articles for a symbol.
QuoteContext.Filings– list filing documents for a symbol.
- Import path: Update imports from
github.com/longportapp/openapi-gotogithub.com/longbridge/openapi-go. - Config files: In TOML/YAML, rename the config section from
[longport]/longport:to[longbridge]/longbridge:. - Environment variables: The recommended prefix is now
LONGBRIDGE_(e.g.LONGBRIDGE_APP_KEY,LONGBRIDGE_APP_SECRET,LONGBRIDGE_ACCESS_TOKEN). The oldLONGPORT_prefix is still supported for backward compatibility. - Config API:
WithOAuthandFromOAuthare removed. Use three keys (app key, secret, access token) orWithOAuthClientonly. - Dependencies: If you depend on them directly, switch from
github.com/longportapp/openapi-protobufs/gen/goandgithub.com/longportapp/openapi-protocol/gotogithub.com/longbridge/openapi-protobufs/gen/go(v0.7.0) andgithub.com/longbridge/openapi-protocol/go(v0.5.0).
- OAuth 2.0 authentication support (
WithOAuthClient, auto-refresh, authorization code flow).
- Module path migrated from
github.com/longportapp/openapi-gotogithub.com/longbridge/openapi-go. - Dependencies migrated to Longbridge:
openapi-protobufs/gen/gov0.7.0,openapi-protocol/gov0.5.0. - Config parsing:
longportrenamed tolongbridgeinparseConfig(TOML/YAML config block keys updated accordingly). - Environment variable prefix: recommended prefix is
LONGBRIDGE_;LONGPORT_remains supported for backward compatibility. - OAuth flow uses
OnOpenURLcallback for opening the authorization page instead of auto-opening the browser. - Config validation: only three keys or OAuthClient supported.
- Config options:
WithOAuth,FromOAuth.