@bombearn/sdk
Version:
Interaction framework for the yearn protocol
58 lines (57 loc) • 2.19 kB
TypeScript
import { Contract, ContractInterface } from "@ethersproject/contracts";
import Emittery from "emittery";
import { ChainId } from "./chain";
import { Context } from "./context";
import { AddressProvider } from "./services/addressProvider";
import { Address } from "./types";
import { Yearn } from "./yearn";
export declare class Service<E = Record<string, unknown>> {
ctx: Context;
chainId: ChainId;
events: Emittery<E>;
constructor(chainId: ChainId, ctx: Context);
}
export declare class ServiceInterface<T extends ChainId, E = Record<string, unknown>> extends Service<E> {
protected yearn: Yearn<T>;
constructor(yearn: Yearn<T>, chainId: T, ctx: Context);
}
/**
* Contract that supports two different providers to differentiate read and
* write operations.
*/
export declare class WrappedContract {
address: Address;
abi: ContractInterface;
read: Contract;
write: Contract;
constructor(address: Address, abi: ContractInterface, ctx: Context);
}
export declare enum ContractAddressId {
oracle = "ORACLE",
adapter_registry_v2 = "REGISTRY_ADAPTER_V2_VAULTS",
helper = "HELPER",
allowlist = "ALLOW_LIST_REGISTRY",
partner = "PARTNER_TRACKER",
zapperZapIn = "ZAPPER_ZAP_IN",
zapperZapOut = "ZAPPER_ZAP_OUT",
portalsZapIn = "PORTALS_ZAP_IN",
portalsZapOut = "PORTALS_ZAP_OUT",
pickleZapIn = "PICKLE_ZAP_IN",
yearnZapEth = "YEARN_ZAP_ETH",
propertiesAggregator = "PROPERTIES_AGGREGATOR",
cowProtocolRelayer = "COW_PROTOCOL_RELAYER",
veYfiRegistry = "VEYFI_REGISTRY",
veYfi = "VEYFI",
claimRewardsZap = "CLAIM_REWARDS_ZAP",
unused = "UNUSED"
}
/**
* A service that has a contract representation on chain.
*/
export declare class ContractService<T extends ChainId, E = Record<string, unknown>> extends Service<E> {
static abi: string[];
static contractId: ContractAddressId;
addressProvider: AddressProvider<T>;
constructor(chainId: T, ctx: Context, addressProvider: AddressProvider<T>);
protected _getContract(abi: string[], contractId: ContractAddressId, ctx: Context): Promise<WrappedContract>;
}