@bombearn/sdk
Version:
Interaction framework for the yearn protocol
25 lines (24 loc) • 856 B
TypeScript
import { ChainId } from "../chain";
import { ContractAddressId, Service } from "../common";
import { Context } from "../context";
import { Address } from "../types";
interface AddressMetadata {
addr: Address;
addrId: string;
}
/**
* [[AddressProviderService]] fetches addresses of various contracts based on the
* network and feeds them to the Yearn SDK.
*/
export declare class AddressProvider<T extends ChainId> extends Service {
static abi: string[];
private contract;
private cachedAddressesById;
constructor(chainId: T, ctx: Context);
static addressByChain(chainId: ChainId): string;
addressById(id: ContractAddressId): Promise<Address>;
private setCachedAddressById;
addressesMetadataByIdStartsWith(prefix: string): Promise<AddressMetadata[]>;
private isCacheFresh;
}
export {};