Skip to content

feat(fundamental): macroeconomic v2 API + keyword/sort support#100

Open
hogan-yuan wants to merge 26 commits into
mainfrom
feat/macroeconomic-v2
Open

feat(fundamental): macroeconomic v2 API + keyword/sort support#100
hogan-yuan wants to merge 26 commits into
mainfrom
feat/macroeconomic-v2

Conversation

@hogan-yuan

@hogan-yuan hogan-yuan commented Jun 12, 2026

Copy link
Copy Markdown
Member

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: MultiLanguageTextstring
  • Macroeconomic.Unit / .UnitPrefix: MultiLanguageTextstring

Cleanup

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

Version

v0.25.1

Related

hogan-yuan and others added 20 commits June 10, 2026 17:50
- MacrodataIndicators: add country parameter (MacrodataCountry enum)
- MacrodataIndicators: return MacrodataIndicatorListResponse with count
- Macrodata: add offset parameter for pagination
- Macrodata: response includes count field
- Add MacrodataImportance enum (1=Low, 2=Medium, 3=High)

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; converts to
'Hong Kong SAR China'/'China (Mainland)'/etc. when sending to API.

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>
…APIValue

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- macroeconomic_indicators / MacroeconomicIndicatorsV2: GET /v2/quote/macrodata
  - market defaults to 'ALL' when country is nil
  - new keyword param for fuzzy name filter
  - maps V2MacroIndicator to existing MacroeconomicIndicator type
- macroeconomic / MacroeconomicV2: 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

Also confirm list endpoint has offset/limit/total.

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

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ator 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>
… to string

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Remove: convertMultiLanguageText, convertMacroeconomicIndicator,
convertMacroeconomic, macroeconomicCountryToAPIValue

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 hogan-yuan marked this pull request as ready for review June 12, 2026 11:04
hogan-yuan and others added 4 commits June 12, 2026 19:05
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- CHANGELOG v0.25.1
- v2 API wire types and routing for macroeconomic interfaces
- string types for Name/Describe/Unit/UnitPrefix

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan changed the title feat(fundamental): add MacroeconomicIndicatorsV2 and MacroeconomicV2 methods (v2 endpoints) feat(fundamental): macroeconomic v2 API + keyword/sort support Jun 12, 2026
- MacroeconomicIndicators: GET /v1 → /v2/quote/macrodata, adds keyword param, uses market code directly
- Macroeconomic: GET /v1 → /v2/quote/macrodata/{id}, defaults sort=desc
- Add convertV2MacroeconomicIndicator/Detail/Macroeconomic converters
- Remove unused v1 converters: convertMacroeconomicIndicator, convertMacroeconomic, macroeconomicCountryToAPIValue, convertMultiLanguageText

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

- start_time/end_time (RFC3339) → start_date/end_date (YYYY-MM-DD) per proto spec
- Add count fallback: if total==0 use len(data), matching Rust behavior

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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