@bombearn/sdk
Version:
Interaction framework for the yearn protocol
32 lines (31 loc) • 1.89 kB
TypeScript
import { ParamType } from "@ethersproject/abi";
import { BigNumber } from "@ethersproject/bignumber";
import { ChainId } from "../chain";
import { ContractAddressId, ContractService, WrappedContract } from "../common";
import { Address } from "../types";
declare type DecodingType = string | BigNumber | boolean;
/**
* [[PropertiesAggregatorService]] allows queries of a contract's methods to be aggregated into one
* call, with the limitation that none of the methods can have arguments. Method names are dynamically provided
* in order to provide flexibility for easily adding or removing property queries in the future
*/
export declare class PropertiesAggregatorService<T extends ChainId> extends ContractService<T> {
static abi: string[];
static contractId: ContractAddressId;
get contract(): Promise<WrappedContract>;
/**
* Fetches a single property from the target contract, assuming no arguments are used for the property
* @param target The target contract to perform the call on
* @param paramType Ethers' `ParamType` object that contains data about the method to call e.g. ParamType.from("string name")
* @returns The decoded result of the property query
*/
getProperty(target: Address, paramType: ParamType): Promise<DecodingType>;
/**
* Simultaneously fetches multiple properties from the target contract, assuming no arguments are used for each property
* @param target The target contract to perform the call on
* @param paramTypes An array of Ethers' `ParamType` object that contains data about the method to call e.g. ParamType.from("string name")
* @returns An object with the inputted property names as keys, and corresponding decoded data as values
*/
getProperties(target: Address, paramTypes: ParamType[]): Promise<Record<string, DecodingType>>;
}
export {};