mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
39 lines
690 B
TypeScript
39 lines
690 B
TypeScript
export type ChainBlocks = {
|
|
[x: string]: number;
|
|
};
|
|
|
|
export type FetchResult = {
|
|
block?: number;
|
|
dailyVolume?: string;
|
|
totalVolume: string;
|
|
timestamp: number;
|
|
};
|
|
|
|
export type Fetch = (
|
|
timestamp: number,
|
|
chainBlocks: ChainBlocks
|
|
) => Promise<FetchResult>;
|
|
|
|
export type VolumeAdapter = {
|
|
[x: string]: {
|
|
start: number | any;
|
|
fetch: Fetch;
|
|
runAtCurrTime?: boolean;
|
|
customBackfill?: any;
|
|
};
|
|
};
|
|
|
|
export type BreakdownAdapter = {
|
|
[x: string]: VolumeAdapter;
|
|
};
|
|
|
|
export type DexVolumeAdapter = {
|
|
volume: VolumeAdapter;
|
|
};
|
|
|
|
export type DexBreakdownAdapter = {
|
|
breakdown: BreakdownAdapter;
|
|
};
|
|
|
|
export type DexAdapter = DexVolumeAdapter | DexBreakdownAdapter;
|