Skip to content

feat(fundamental): add macroeconomic_indicators_v2 and macroeconomic_v2 methods (v2 endpoints)#543

Merged
hogan-yuan merged 19 commits into
mainfrom
feat/macroeconomic-v2
Jun 13, 2026
Merged

feat(fundamental): add macroeconomic_indicators_v2 and macroeconomic_v2 methods (v2 endpoints)#543
hogan-yuan merged 19 commits into
mainfrom
feat/macroeconomic-v2

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

Summary

Switches the macroeconomic indicator APIs to v2 endpoints while keeping existing method signatures and output types unchanged. All language SDKs updated.

Changes

Existing methods (unchanged signatures, route to v2 internally)

  • macroeconomic_indicators(country, offset, limit) → delegates to macroeconomic_indicators_v2
  • macroeconomic(indicator_code, start_date, end_date, offset, limit) → delegates to macroeconomic_v2

New v2 methods

  • macroeconomic_indicators_v2(country, keyword, offset, limit)GET /v2/quote/macrodata
    • keyword: optional fuzzy filter on indicator name
    • country None defaults to market=ALL
    • offset/limit passed through for pagination; response count uses API total
  • macroeconomic_v2(indicator_code, start_date, end_date, offset, limit, sort)GET /v2/quote/macrodata/{indicator_id}
    • sort: "asc" or "desc"
    • Response maps single indicator object to existing MacroeconomicResponse

v2 response → existing type mapping

v2 field SDK field
indicator_id (int32) indicator_code (string)
indicator_name name.english
observation_date Macroeconomic.period
published_time Macroeconomic.release_at
actual_data Macroeconomic.actual_value
total count (for pagination)

Languages updated

Rust, Python, Node.js, Java (all bindings add _v2 variants with extra params)

Related

  • Go SDK: longbridge/openapi-go#feat/macroeconomic-v2

hogan-yuan and others added 17 commits June 12, 2026 13:54
- macroeconomic_indicators / macroeconomic_indicators_v2: GET /v2/quote/macrodata
  - market defaults to 'ALL' when country is None
  - new keyword param for fuzzy name filter
  - maps V2MacroIndicator to existing MacroeconomicIndicator type
- macroeconomic / macroeconomic_v2: GET /v2/quote/macrodata/{id}
  - new sort param (asc/desc)
  - maps V2MacroIndicatorDetail to existing MacroeconomicResponse type
- original method signatures unchanged; _v2 variants add new params

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ndicator_data_list

GetMacroIndicatorHistoryResp returns:
  indicator: MacroIndicatorDetail  (single object)
  total: int32

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ly cargo fmt

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>
…e type and list mapping

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
MacroIndicatorItem.frequence maps to MacroeconomicIndicator.periodicity

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ageText to string

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…t to string

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>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
hogan-yuan and others added 2 commits June 12, 2026 19:42
- Rust: macroeconomic_indicators_v2/macroeconomic_v2 -> pub(crate)
- Python: remove _v2 methods from sync/async bindings
- Node.js: remove _v2 methods from napi binding
- Java: remove getMacroeconomicIndicatorsV2/getMacroeconomicV2

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
fundamentalContextMacroeconomicIndicatorsV2 and fundamentalContextMacroeconomicV2
called pub(crate) methods that are no longer accessible from the java crate.
The Java public API (getMacroeconomicIndicators/getMacroeconomic) already delegates
to the correct public Rust methods.

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 13, 2026
## Summary

Switches macroeconomic APIs to v2 endpoints and simplifies types.

## Changes

### New / updated methods

- `MacroeconomicIndicators(ctx, country, keyword, offset, limit)` — `GET
/v2/quote/macrodata`
  - Added `keyword` for fuzzy name filtering (case-insensitive)
  - Now returns `Periodicity`, `Describe`, `Importance` from v2 API
- `Macroeconomic(ctx, indicatorCode, startDate, endDate, offset, limit)`
— `GET /v2/quote/macrodata/{id}`
  - Defaults to `sort=desc` (newest first)
  - Returns `Unit` string from v2 API

### Type simplifications

- `MacroeconomicIndicator.Name` / `.Describe`: `MultiLanguageText` →
`string`
- `Macroeconomic.Unit` / `.UnitPrefix`: `MultiLanguageText` → `string`

### Cleanup

- Removed unused helpers: `convertMacroeconomicIndicator`,
`convertMultiLanguageText`, `convertMacroeconomic`,
`macroeconomicCountryToAPIValue`
- Internal `_v2` method variants hidden from public API

## Version

`v0.25.1`

## Related

- Upstream (all language SDKs): longbridge/openapi#543

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan merged commit ff567d0 into main Jun 13, 2026
56 checks passed
@hogan-yuan hogan-yuan deleted the feat/macroeconomic-v2 branch June 13, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant