Skip to content

Commit d946742

Browse files
committed
fix: handle Probable events API returning raw array instead of { events: [] }
1 parent 16806a2 commit d946742

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/exchanges/probable/fetcher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ export class ProbableFetcher implements IExchangeFetcher<ProbableRawMarket, Prob
421421
queryParams.ascending = false;
422422

423423
const response = await this.ctx.http.get(`${BASE_URL}${EVENTS_PATH}`, { params: queryParams });
424-
return response.data?.events || [];
424+
const data = response.data;
425+
// API returns either a raw array or { events: [...] }
426+
return Array.isArray(data) ? data : (data?.events || []);
425427
}
426428

427429
private async fetchRawEventsViaSearch(params: EventFetchParams): Promise<ProbableRawEvent[]> {

0 commit comments

Comments
 (0)