HTTP REST 사용
마켓 기록 조회
복사
AI에게 묻기
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { IndexerRestMarketChronosApi } from "@injectivelabs/sdk-ts/client/indexer";
const endpoints = getNetworkEndpoints(Network.Testnet);
const indexerRestMarketChronosApi = new IndexerRestMarketChronosApi(
`${endpoints.chronos}/api/chronos/v1/market`
);
const SelectList = {
Hour: "60",
Day: "1d",
Week: "7d",
};
const marketIds = ["0x"];
const countback = 154; // 시간 단위
const resolution = SelectList.Day;
const marketsHistory = await indexerRestMarketChronosApi.fetchMarketsHistory({
marketIds,
resolution,
countback,
});
console.log(marketsHistory);
