mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
1.8 KiB
87 lines
1.8 KiB
import {
|
|
DataProviderHistoricalResponse,
|
|
DataProviderResponse
|
|
} from '@ghostfolio/api/services/interfaces/interfaces';
|
|
import {
|
|
DataProviderInfo,
|
|
LookupResponse
|
|
} from '@ghostfolio/common/interfaces';
|
|
import { Granularity } from '@ghostfolio/common/types';
|
|
|
|
import { DataSource, SymbolProfile } from '@prisma/client';
|
|
|
|
export interface DataProviderInterface {
|
|
canHandle(symbol: string): boolean;
|
|
|
|
getAssetProfile({
|
|
symbol
|
|
}: GetAssetProfileParams): Promise<Partial<SymbolProfile>>;
|
|
|
|
getDataProviderInfo(): DataProviderInfo;
|
|
|
|
getDividends({
|
|
from,
|
|
granularity,
|
|
requestTimeout,
|
|
symbol,
|
|
to
|
|
}: GetDividendsParams): Promise<{
|
|
[date: string]: DataProviderHistoricalResponse;
|
|
}>;
|
|
|
|
getHistorical({
|
|
from,
|
|
granularity,
|
|
requestTimeout,
|
|
symbol,
|
|
to
|
|
}: GetHistoricalParams): Promise<{
|
|
[symbol: string]: { [date: string]: DataProviderHistoricalResponse };
|
|
}>; // TODO: Return only one symbol
|
|
|
|
getMaxNumberOfSymbolsPerRequest?(): number;
|
|
|
|
getName(): DataSource;
|
|
|
|
getQuotes({
|
|
requestTimeout,
|
|
symbols
|
|
}: GetQuotesParams): Promise<{ [symbol: string]: DataProviderResponse }>;
|
|
|
|
getTestSymbol(): string;
|
|
|
|
search({ includeIndices, query }: GetSearchParams): Promise<LookupResponse>;
|
|
}
|
|
|
|
export interface GetAssetProfileParams {
|
|
requestTimeout?: number;
|
|
symbol: string;
|
|
}
|
|
|
|
export interface GetDividendsParams {
|
|
from: Date;
|
|
granularity?: Granularity;
|
|
requestTimeout?: number;
|
|
symbol: string;
|
|
to: Date;
|
|
}
|
|
|
|
export interface GetHistoricalParams {
|
|
from: Date;
|
|
granularity?: Granularity;
|
|
requestTimeout?: number;
|
|
symbol: string;
|
|
to: Date;
|
|
}
|
|
|
|
export interface GetQuotesParams {
|
|
requestTimeout?: number;
|
|
symbols: string[];
|
|
}
|
|
|
|
export interface GetSearchParams {
|
|
includeIndices?: boolean;
|
|
query: string;
|
|
requestTimeout?: number;
|
|
userId?: string;
|
|
}
|
|
|