Skip to main content

Class: ChartService

Gala Launchpad SDK 9.0.0-rc.5


Gala Launchpad SDK 9.0.0-rc.5 / index / ChartService

Class: ChartService

Defined in: packages/launchpad-sdk/dist/services/ChartService.d.ts:70

Chart Service Class

Provides methods for fetching historical chart data.

Example​

const chartService = new ChartService(httpClient);

// Get hourly chart data for last 24 hours
const now = Math.floor(Date.now() / 1000);
const oneDayAgo = now - (24 * 60 * 60);
const chart = await chartService.getChart({
tokenName: 'mytoken',
from: oneDayAgo,
to: now,
resolution: 3600
});

Extends​

  • BaseService

Constructors​

Constructor​

new ChartService(http, debugMode?): ChartService

Defined in: packages/launchpad-sdk/dist/services/ChartService.d.ts:71

Parameters​

http​

HttpClient

debugMode?​

boolean

Returns​

ChartService

Overrides​

BaseService.constructor

Methods​

getChart()​

getChart(options): Promise<ChartResult>

Defined in: packages/launchpad-sdk/dist/services/ChartService.d.ts:104

Get historical chart data

Retrieve OHLC (Open, High, Low, Close) candlestick data for token price history. Data is aggregated at the specified resolution interval.

Parameters​

options​

GetChartOptions

Chart fetch options

Returns​

Promise<ChartResult>

Promise resolving to chart data with candlesticks

Example​

// Get hourly data for last 24 hours
const now = Math.floor(Date.now() / 1000);
const oneDayAgo = now - (24 * 60 * 60);
const chart = await chartService.getChart({
tokenName: 'anime',
from: oneDayAgo,
to: now,
resolution: 3600
});
console.log(`Got ${chart.dataPoints.length} candlesticks`);

// Get minute-level data for 1 hour
const oneHourAgo = now - 3600;
const minuteChart = await chartService.getChart({
tokenName: 'anime',
from: oneHourAgo,
to: now,
resolution: 60
});

setJwtAuth()​

setJwtAuth(jwtAuth): void

Defined in: packages/launchpad-sdk/dist/services/BaseService.d.ts:50

Set the JWT authentication manager. Allows dynamic configuration of JWT auth after service creation.

Parameters​

jwtAuth​

JwtAuth

JWT auth manager instance

Returns​

void

Inherited from​

BaseService.setJwtAuth