MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / listStockTickers

Function listStockTickers

services/tickers/listTickers.js:138–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136}
137
138export async function listStockTickers() {
139 const { tickers, page } = await fetchStockTickers({
140 pageNumber: 1,
141 pageSize: PAGE_SIZE,
142 });
143
144 const totalPages = Math.ceil(page.totalRecords / PAGE_SIZE);
145 const promises = [];
146 for (let i = 2; i <= totalPages; i += 1) {
147 promises.push(fetchStockTickers({ pageNumber: i, pageSize: PAGE_SIZE }));
148 }
149
150 const results = await Promise.all(promises);
151
152 for (let i = 0; i < results.length; i += 1) {
153 const { tickers: newTickers } = results[i];
154 tickers.push(...newTickers);
155 }
156
157 return tickers;
158}
159
160export async function listInvestmentFundTickers({ typeFund }) {
161 const { tickers, page } = await fetchInvestmentFundTickers({

Callers 1

actionFunction · 0.90

Calls 1

fetchStockTickersFunction · 0.85

Tested by

no test coverage detected