Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b87f40e
feat: switch macroeconomic APIs to v2 endpoints
hogan-yuan Jun 12, 2026
f58c70d
feat: pass offset/limit to v2 and handle total from pagination response
hogan-yuan Jun 12, 2026
0925719
fix: update v2 detail response to use indicator (single) instead of i…
hogan-yuan Jun 12, 2026
c4ab601
fix: support both indicator/indicator_data_list response formats; app…
hogan-yuan Jun 12, 2026
643c09a
refactor: remove indicator_data_list compatibility, use indicator only
hogan-yuan Jun 12, 2026
ff50bc7
chore: update nodejs binary and apply cargo fmt to blocking context
hogan-yuan Jun 12, 2026
184f609
feat: add periodicity/description/importance to v2 MacroIndicator wir…
hogan-yuan Jun 12, 2026
2205e1b
fix: use frequence (not periodicity) as field name from v2 proto
hogan-yuan Jun 12, 2026
b31a6ee
refactor: change MacroeconomicIndicator.name/describe from MultiLangu…
hogan-yuan Jun 12, 2026
5e84da1
refactor: change Macroeconomic.unit/unit_prefix from MultiLanguageTex…
hogan-yuan Jun 12, 2026
db9675c
fix: use string directly for name/describe in v2 detail mapping
hogan-yuan Jun 12, 2026
3ef47b8
feat: default sort to desc in macroeconomic_v2
hogan-yuan Jun 12, 2026
3996822
feat: add keyword param to macroeconomic_indicators; hide _v2 variants
hogan-yuan Jun 12, 2026
a4c588b
style: apply cargo fmt to blocking/fundamental.rs
hogan-yuan Jun 12, 2026
cb9bac8
chore: release 4.3.2
hogan-yuan Jun 12, 2026
e816bc9
docs: simplify CHANGELOG for 4.3.2
hogan-yuan Jun 12, 2026
e68728f
Merge remote-tracking branch 'origin/chore/release-v4.3.2' into feat/…
hogan-yuan Jun 12, 2026
3b27c24
refactor: hide _v2 methods from public API
hogan-yuan Jun 12, 2026
910e09d
fix(java): remove orphaned JNI functions calling private v2 methods
hogan-yuan Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.3.2] - 2026-06-13

### Added

- **All languages:** `macroeconomic_indicators` gains `keyword` parameter for fuzzy name filtering
- **All languages:** `macroeconomic` switches to `GET /v2/quote/macrodata/{id}`, defaults to `sort=desc`

### Changed

- `MacroeconomicIndicator.name` / `.describe`: `MultiLanguageText` → `string`
- `Macroeconomic.unit` / `.unit_prefix`: `MultiLanguageText` → `string`

## [4.3.1] - 2026-06-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "3"
members = ["rust", "python", "nodejs", "java", "c"]

[workspace.package]
version = "4.3.1"
version = "4.3.2"
edition = "2024"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion java/javasrc/src/main/java/com/longbridge/SdkNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static native void fundamentalContextGetFinancialReportSnapshot(long cont
AsyncCallback callback);

public static native void fundamentalContextMacroeconomicIndicators(long context,
Object country, Object offset, Object limit,
Object country, Object keyword, Object offset, Object limit,
AsyncCallback callback);

public static native void fundamentalContextMacroeconomic(long context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ public CompletableFuture<ValuationComparisonResponse> getValuationComparison(Val
* List macroeconomic indicators.
* country: ISO country code string (e.g. "US", "CN", "EU"); pass null for all countries.
*/
public CompletableFuture<MacroeconomicIndicatorListResponse> getMacroeconomicIndicators(String country, Integer offset, Integer limit) throws OpenApiException {
public CompletableFuture<MacroeconomicIndicatorListResponse> getMacroeconomicIndicators(String country, String keyword, Integer offset, Integer limit) throws OpenApiException {
return AsyncCallback.executeTask((callback) -> {
SdkNative.fundamentalContextMacroeconomicIndicators(raw, country, offset, limit, callback);
SdkNative.fundamentalContextMacroeconomicIndicators(raw, country, keyword, offset, limit, callback);
});
}

Expand All @@ -354,4 +354,10 @@ public CompletableFuture<MacroeconomicResponse> getMacroeconomic(String indicato
SdkNative.fundamentalContextMacroeconomic(raw, indicatorCode, startDate, endDate, offset, limit, callback);
});
}

/**
* List macroeconomic indicators (v2) with optional keyword filter.
* country: "HK","CN","US","EU","JP","SG" or null for ALL.
* keyword: optional fuzzy filter on indicator name.
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class Macroeconomic {
public String forecastValue;
public String revisedValue;
public String nextReleaseAt;
public MultiLanguageText unit;
public MultiLanguageText unitPrefix;
public String unit;
public String unitPrefix;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public class MacroeconomicIndicator {
public String indicatorCode;
public String sourceOrg;
public String country;
public MultiLanguageText name;
public String name;
public String adjustmentFactor;
/** Release periodicity (e.g. monthly / quarterly). */
public String periodicity;
public String category;
public MultiLanguageText describe;
public String describe;
/** Importance — higher is more important. */
public int importance;
/** Start date of data coverage (unix timestamp string). */
Expand Down
4 changes: 3 additions & 1 deletion java/src/fundamental_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ pub unsafe extern "system" fn Java_com_longbridge_SdkNative_fundamentalContextMa
_class: JClass,
context: i64,
country: JObject,
keyword: JObject,
offset: JObject,
limit: JObject,
callback: JObject,
Expand All @@ -288,12 +289,13 @@ pub unsafe extern "system" fn Java_com_longbridge_SdkNative_fundamentalContextMa
_ => None,
}
});
let keyword: Option<String> = FromJValue::from_jvalue(env, keyword.into())?;
let offset: Option<i32> = FromJValue::from_jvalue(env, offset.into())?;
let limit: Option<i32> = FromJValue::from_jvalue(env, limit.into())?;
async_util::execute(env, callback, async move {
Ok(context
.ctx
.macroeconomic_indicators(country, offset, limit)
.macroeconomic_indicators(country, keyword, offset, limit)
.await?)
})?;
Ok(())
Expand Down
12 changes: 8 additions & 4 deletions nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,10 @@ export declare class FundamentalContext {
macroeconomicIndicators(country?: MacroeconomicCountry | undefined | null, offset?: number | undefined | null, limit?: number | undefined | null): Promise<MacroeconomicIndicatorListResponse>
/** Get historical data for a macroeconomic indicator */
macroeconomic(indicatorCode: string, startDate?: string | undefined | null, endDate?: string | undefined | null, offset?: number | undefined | null, limit?: number | undefined | null): Promise<MacroeconomicResponse>
/** List macroeconomic indicators (v2) with optional keyword filter */
macroeconomicIndicatorsV2(country?: MacroeconomicCountry | undefined | null, keyword?: string | undefined | null, offset?: number | undefined | null, limit?: number | undefined | null): Promise<MacroeconomicIndicatorListResponse>
/** Get historical data for a macroeconomic indicator (v2) with sort support */
macroeconomicV2(indicatorCode: string, startDate?: string | undefined | null, endDate?: string | undefined | null, offset?: number | undefined | null, limit?: number | undefined | null, sort?: string | undefined | null): Promise<MacroeconomicResponse>
}

/** Fund position */
Expand Down Expand Up @@ -4488,8 +4492,8 @@ export interface Macroeconomic {
revisedValue: string
/** Next release datetime (unix timestamp in seconds; null if unset) */
nextReleaseAt?: number
unit: MultiLanguageText
unitPrefix: MultiLanguageText
unit: string
unitPrefix: string
}

/** Country code for filtering macroeconomic indicators */
Expand All @@ -4513,11 +4517,11 @@ export interface MacroeconomicIndicator {
indicatorCode: string
sourceOrg: string
country: string
name: MultiLanguageText
name: string
adjustmentFactor: string
periodicity: string
category: string
describe: MultiLanguageText
describe: string
importance: number
/** Start date of data coverage (unix timestamp in seconds; null if unset) */
startDate?: number
Expand Down
2 changes: 1 addition & 1 deletion nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ module.exports.FlowDirection = nativeBinding.FlowDirection
module.exports.Granularity = nativeBinding.Granularity
module.exports.InstitutionRecommend = nativeBinding.InstitutionRecommend
module.exports.Language = nativeBinding.Language
module.exports.MacrodataCountry = nativeBinding.MacrodataCountry
module.exports.MacroeconomicCountry = nativeBinding.MacroeconomicCountry
module.exports.Market = nativeBinding.Market
module.exports.OptionDirection = nativeBinding.OptionDirection
module.exports.OptionType = nativeBinding.OptionType
Expand Down
3 changes: 2 additions & 1 deletion nodejs/src/fundamental/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,13 @@ impl FundamentalContext {
pub async fn macroeconomic_indicators(
&self,
country: Option<MacroeconomicCountry>,
keyword: Option<String>,
offset: Option<i32>,
limit: Option<i32>,
) -> Result<MacroeconomicIndicatorListResponse> {
Ok(self
.ctx
.macroeconomic_indicators(country.map(Into::into), offset, limit)
.macroeconomic_indicators(country.map(Into::into), keyword, offset, limit)
.await
.map_err(ErrorNewType)?
.into())
Expand Down
16 changes: 8 additions & 8 deletions nodejs/src/fundamental/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1979,11 +1979,11 @@ pub struct MacroeconomicIndicator {
pub indicator_code: String,
pub source_org: String,
pub country: String,
pub name: MultiLanguageText,
pub name: String,
pub adjustment_factor: String,
pub periodicity: String,
pub category: String,
pub describe: MultiLanguageText,
pub describe: String,
pub importance: i32,
/// Start date of data coverage (unix timestamp in seconds; null if unset)
pub start_date: Option<i64>,
Expand All @@ -1995,11 +1995,11 @@ impl From<lb::MacroeconomicIndicator> for MacroeconomicIndicator {
indicator_code: v.indicator_code,
source_org: v.source_org,
country: v.country,
name: v.name.into(),
name: v.name,
adjustment_factor: v.adjustment_factor,
periodicity: v.periodicity,
category: v.category,
describe: v.describe.into(),
describe: v.describe,
importance: v.importance,
start_date: v.start_date.map(|dt| dt.unix_timestamp()),
}
Expand All @@ -2019,8 +2019,8 @@ pub struct Macroeconomic {
pub revised_value: String,
/// Next release datetime (unix timestamp in seconds; null if unset)
pub next_release_at: Option<i64>,
pub unit: MultiLanguageText,
pub unit_prefix: MultiLanguageText,
pub unit: String,
pub unit_prefix: String,
}

impl From<lb::Macroeconomic> for Macroeconomic {
Expand All @@ -2033,8 +2033,8 @@ impl From<lb::Macroeconomic> for Macroeconomic {
forecast_value: v.forecast_value,
revised_value: v.revised_value,
next_release_at: v.next_release_at.map(|dt| dt.unix_timestamp()),
unit: v.unit.into(),
unit_prefix: v.unit_prefix.into(),
unit: v.unit,
unit_prefix: v.unit_prefix,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions python/pysrc/longbridge/openapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10118,12 +10118,12 @@ class MacroeconomicIndicator:
"""External vendor code (input to macroeconomic)"""
source_org: str
country: str
name: MultiLanguageText
name: str
adjustment_factor: str
periodicity: str
"""Release periodicity (e.g. monthly / quarterly)"""
category: str
describe: MultiLanguageText
describe: str
importance: int
start_date: datetime | None
"""Start date of data coverage"""
Expand All @@ -10140,8 +10140,8 @@ class Macroeconomic:
forecast_value: str
revised_value: str
next_release_at: datetime | None
unit: MultiLanguageText
unit_prefix: MultiLanguageText
unit: str
unit_prefix: str


class MacroeconomicResponse:
Expand Down
3 changes: 2 additions & 1 deletion python/src/fundamental/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,13 @@ impl FundamentalContext {
fn macroeconomic_indicators(
&self,
country: Option<MacroeconomicCountry>,
keyword: Option<String>,
offset: Option<i32>,
limit: Option<i32>,
) -> PyResult<MacroeconomicIndicatorListResponse> {
Ok(self
.ctx
.macroeconomic_indicators(country.map(Into::into), offset, limit)
.macroeconomic_indicators(country.map(Into::into), keyword, offset, limit)
.map_err(ErrorNewType)?
.into())
}
Expand Down
3 changes: 2 additions & 1 deletion python/src/fundamental/context_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,14 @@ impl AsyncFundamentalContext {
&self,
py: Python<'_>,
country: Option<MacroeconomicCountry>,
keyword: Option<String>,
offset: Option<i32>,
limit: Option<i32>,
) -> PyResult<Py<PyAny>> {
let ctx = self.ctx.clone();
pyo3_async_runtimes::tokio::future_into_py(py, async move {
Ok(MacroeconomicIndicatorListResponse::from(
ctx.macroeconomic_indicators(country.map(Into::into), offset, limit)
ctx.macroeconomic_indicators(country.map(Into::into), keyword, offset, limit)
.await
.map_err(ErrorNewType)?,
))
Expand Down
16 changes: 8 additions & 8 deletions python/src/fundamental/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2036,11 +2036,11 @@ pub(crate) struct MacroeconomicIndicator {
pub indicator_code: String,
pub source_org: String,
pub country: String,
pub name: MultiLanguageText,
pub name: String,
pub adjustment_factor: String,
pub periodicity: String,
pub category: String,
pub describe: MultiLanguageText,
pub describe: String,
pub importance: i32,
pub start_date: Option<crate::time::PyOffsetDateTimeWrapper>,
}
Expand All @@ -2051,11 +2051,11 @@ impl From<lb::MacroeconomicIndicator> for MacroeconomicIndicator {
indicator_code: v.indicator_code,
source_org: v.source_org,
country: v.country,
name: v.name.into(),
name: v.name,
adjustment_factor: v.adjustment_factor,
periodicity: v.periodicity,
category: v.category,
describe: v.describe.into(),
describe: v.describe,
importance: v.importance,
start_date: v.start_date.map(crate::time::PyOffsetDateTimeWrapper),
}
Expand All @@ -2073,8 +2073,8 @@ pub(crate) struct Macroeconomic {
pub forecast_value: String,
pub revised_value: String,
pub next_release_at: Option<crate::time::PyOffsetDateTimeWrapper>,
pub unit: MultiLanguageText,
pub unit_prefix: MultiLanguageText,
pub unit: String,
pub unit_prefix: String,
}

impl From<lb::Macroeconomic> for Macroeconomic {
Expand All @@ -2087,8 +2087,8 @@ impl From<lb::Macroeconomic> for Macroeconomic {
forecast_value: v.forecast_value,
revised_value: v.revised_value,
next_release_at: v.next_release_at.map(crate::time::PyOffsetDateTimeWrapper),
unit: v.unit.into(),
unit_prefix: v.unit_prefix.into(),
unit: v.unit,
unit_prefix: v.unit_prefix,
}
}
}
Expand Down
34 changes: 33 additions & 1 deletion rust/src/blocking/fundamental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,13 @@ impl FundamentalContextSync {
pub fn macroeconomic_indicators(
&self,
country: Option<MacroeconomicCountry>,
keyword: Option<impl Into<String> + Send + 'static>,
offset: Option<i32>,
limit: Option<i32>,
) -> Result<MacroeconomicIndicatorListResponse> {
self.rt.call(move |ctx| async move {
ctx.macroeconomic_indicators(country, offset, limit).await
ctx.macroeconomic_indicators(country, keyword, offset, limit)
.await
})
}

Expand All @@ -317,4 +319,34 @@ impl FundamentalContextSync {
.await
})
}

/// List macroeconomic indicators (v2) with optional keyword filter
pub(crate) fn macroeconomic_indicators_v2(
&self,
country: Option<MacroeconomicCountry>,
keyword: Option<impl Into<String> + Send + 'static>,
offset: Option<i32>,
limit: Option<i32>,
) -> Result<MacroeconomicIndicatorListResponse> {
self.rt.call(move |ctx| async move {
ctx.macroeconomic_indicators_v2(country, keyword, offset, limit)
.await
})
}

/// Get historical data for a macroeconomic indicator (v2) with sort support
pub(crate) fn macroeconomic_v2(
&self,
indicator_code: impl Into<String> + Send + 'static,
start_date: Option<impl Into<String> + Send + 'static>,
end_date: Option<impl Into<String> + Send + 'static>,
offset: Option<i32>,
limit: Option<i32>,
sort: Option<impl Into<String> + Send + 'static>,
) -> Result<MacroeconomicResponse> {
self.rt.call(move |ctx| async move {
ctx.macroeconomic_v2(indicator_code, start_date, end_date, offset, limit, sort)
.await
})
}
}
Loading
Loading