@sky-mavis/smart-order-router
Version:
Ronin Swap Smart Order Router
24 lines (23 loc) • 920 B
TypeScript
import { ChainId } from '@sky-mavis/katana-core';
import { ICache } from '../cache';
import { IV2SubgraphProvider, V2SubgraphPool } from './subgraph-provider';
/**
* Provider for getting V2 pools, with functionality for caching the results.
*
* @export
* @class CachingV2SubgraphProvider
*/
export declare class CachingV2SubgraphProvider implements IV2SubgraphProvider {
private chainId;
protected subgraphProvider: IV2SubgraphProvider;
private cache;
private SUBGRAPH_KEY;
/**
* Creates an instance of CachingV2SubgraphProvider.
* @param chainId The chain id to use.
* @param subgraphProvider The provider to use to get the subgraph pools when not in the cache.
* @param cache Cache instance to hold cached pools.
*/
constructor(chainId: ChainId, subgraphProvider: IV2SubgraphProvider, cache: ICache<V2SubgraphPool[]>);
getPools(): Promise<V2SubgraphPool[]>;
}