redstone-api
Version:
Javascript library for fetching trusted token pricing data from Redstone data ecosystem
50 lines (49 loc) • 1.44 kB
TypeScript
export declare type ConvertableToDate = Date | number | string;
export interface RedstoneApiConfig {
useCache?: boolean;
defaultProvider?: string;
version?: string;
verifySignature?: boolean;
cacheApiUrl?: string;
}
export interface RedstoneApiConfigForQueryExec extends RedstoneApiConfig {
provider?: string;
}
export interface PriceData {
id?: string;
symbol: string;
provider: string;
value: number;
permawebTx: string;
source?: string;
timestamp: number;
}
export interface PriceDataWithSignature extends PriceData {
signature: string;
version?: string;
providerPublicKey: string;
}
export interface ProviderNameToAddressMapping {
[name: string]: string;
}
export interface GetPriceOptions {
provider?: string;
verifySignature?: boolean;
}
export interface GetHistoricalPriceOptions extends GetPriceOptions {
date: ConvertableToDate;
}
export declare type GetHistoricalPriceForSingleTokenOptions = GetHistoricalPriceInTimeRangeOptions | GetHistoricalPriceWithPaginationOptions;
interface GetHistoricalPriceWithPaginationOptions extends GetPriceOptions {
offset: number;
limit: number;
startDate?: ConvertableToDate;
endDate?: ConvertableToDate;
interval?: number;
}
interface GetHistoricalPriceInTimeRangeOptions extends GetPriceOptions {
startDate: ConvertableToDate;
endDate: ConvertableToDate;
interval: number;
}
export {};