feat(fundamental): add macrodata_indicators and macrodata methods#540
Open
hogan-yuan wants to merge 24 commits into
Open
feat(fundamental): add macrodata_indicators and macrodata methods#540hogan-yuan wants to merge 24 commits into
hogan-yuan wants to merge 24 commits into
Conversation
… methods
Two new methods on FundamentalContext across all language SDKs:
- economic_indicator_list: GET /v1/quote/macrodata
- economic_indicator: GET /v1/quote/macrodata/{indicator_code}
New types: MultiLanguageText, EconomicIndicatorInfo, EconomicIndicatorData,
EconomicIndicatorResponse.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- EconomicIndicatorInfo.start_date: String -> Option<OffsetDateTime> - EconomicIndicatorData.release_at/next_release_at: String -> Option<OffsetDateTime> Python: PyOffsetDateTimeWrapper (datetime), Node.js: Option<i64> (unix seconds). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…FC3339) Input params now accept OffsetDateTime and are serialized as RFC3339 (2024-01-01T00:00:00Z) to match API requirements. - Rust/Python: Option<OffsetDateTime> - Node.js: Option<i64> unix seconds (converted internally) - Java: Option<OffsetDateTime> - Go: *time.Time Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
start_date -> start_time: YYYY-MM-DDT00:00:00Z end_date -> end_time: YYYY-MM-DDT23:59:59Z Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
EconomicIndicatorInfo -> MacrodataIndicatorInfo EconomicIndicatorData -> MacrodataRecord EconomicIndicatorResponse -> MacrodataResponse Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
MacrodataIndicatorInfo -> MacrodataIndicator MacrodataRecord -> Macrodata Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- start_date/release_at/next_release_at: timestamp_opt -> rfc3339_opt (API returns RFC3339 strings, not unix seconds) - EconomicIndicatorListResponse: rename data field to list Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
describe field can be null in API response; use null_as_default deserializer to map null -> Default (empty strings). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Vec<T> does not implement IntoJValue; ObjectArray<T> does. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…uild Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
hogan-yuan
added a commit
to longbridge/openapi-go
that referenced
this pull request
Jun 10, 2026
## Summary
Two new methods on `FundamentalContext`:
- `MacrodataIndicators(ctx, offset, limit)` — `GET /v1/quote/macrodata`
— list all macroeconomic indicators (~619 total)
- `Macrodata(ctx, indicatorCode, startDate, endDate, limit)` — `GET
/v1/quote/macrodata/{indicator_code}` — fetch historical data for one
indicator
`startDate` / `endDate` accept `"YYYY-MM-DD"` strings and are sent to
the API as `YYYY-MM-DDT00:00:00Z` / `YYYY-MM-DDT23:59:59Z`.
## New Types
| Type | Description |
|------|-------------|
| `MultiLanguageText` | Localized text (English / Simplified Chinese /
Traditional Chinese) |
| `MacrodataIndicator` | Indicator metadata (code, country, category,
periodicity, importance, etc.) |
| `Macrodata` | One historical data point (period,
actual/previous/forecast/revised values, release timestamps, unit) |
| `MacrodataResponse` | `Info MacrodataIndicator` + `Data []Macrodata` |
## Time field formats
All timestamp fields (`StartDate`, `ReleaseAt`, `NextReleaseAt`) are
returned as `*time.Time` (UTC) — consistent with other SDK methods.
## Related
- Upstream (all language SDKs): longbridge/openapi#540
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…istResponse Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
3 tasks
- MacrodataIndicator.name: #[serde(default)] -> null_as_default - Macrodata.unit / unit_prefix: same - MacrodataResponse.info: add null_as_default (was missing entirely) - Derive Default on MacrodataIndicator and Macrodata to support null_as_default Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- macrodata_indicators: add country param (MacrodataCountry enum), returns MacrodataIndicatorListResponse with count - macrodata: add offset param for pagination, response includes count - Add MacrodataImportance (1=Low/2=Medium/3=High) and MacrodataCountry enums Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
SDK accepts HK/CN/US/EU/JP/SG shortcodes; serde renames to full strings
('Hong Kong SAR China'/'China (Mainland)'/etc.) when serializing to query params.
Java JNI also accepts both shortcodes and full strings.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…factor Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ng for country query param serde_urlencoded cannot serialize enums — convert MacrodataCountry to its API string value before building the query struct. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
hogan-yuan
added a commit
to longbridge/longbridge-terminal
that referenced
this pull request
Jun 10, 2026
New SDK changes: - macrodata_indicators() gains country filter (MacrodataCountry enum) - macrodata() gains offset parameter for pagination - Both responses now include count (total records) - null deserialization bug fixed in SDK (name/unit/unit_prefix/info) CLI changes: - Add --country flag (HK/CN/US/EU/JP/SG) for indicator list filtering - --page now applies to both list and history (offset = (page-1) * limit) - JSON output includes top-level count field in both modes - Pretty list output prints total count above the table Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new methods on
FundamentalContextacross all language SDKs (Rust, Python, Node.js, Java):macrodata_indicators(offset, limit)—GET /v1/quote/macrodata— list all macroeconomic indicators (~619 total)macrodata(indicator_code, start_date, end_date, limit)—GET /v1/quote/macrodata/{indicator_code}— fetch historical data for one indicatorstart_date/end_dateaccept"YYYY-MM-DD"strings and are sent to the API asYYYY-MM-DDT00:00:00Z/YYYY-MM-DDT23:59:59Z.New Types
MultiLanguageTextMacrodataIndicatorMacrodataMacrodataResponseinfo: MacrodataIndicator+data: Vec<Macrodata>Time field formats
All timestamp fields (
start_date,release_at,next_release_at) are returned asOffsetDateTime(Rust / Java),datetime(Python),i64unix seconds (Node.js) — consistent with other SDK methods.Related