UNPKG

@volare.finance/volare.js

Version:
131 lines (130 loc) 4.51 kB
/** * @file Addressbook.ts * @author astra <astra@volare.finance> * @date 2022 */ import { TransactionResponse } from '@ethersproject/providers'; import { Address, Provider } from '@volare.finance/utils.js'; import { ContractInterface, Wallet } from 'ethers'; export declare class Addressbook extends Provider { static ORACLE: string; static VTOKEN_IMPL: string; static VTOKEN_FACTORY: string; static WHITELIST: string; static MARGIN_POOL: string; static MARGIN_CALCULATOR: string; static LIQUIDATION_MANAGER: string; static CONTROLLER: string; static ABI(): ContractInterface; constructor(contract: Address, endpoint: string); /** * @notice return Oracle address * @return Oracle address */ getOracle(): Promise<Address>; /** * @notice return VToken implementation address * @return VToken implementation address */ getVTokenImpl(): Promise<Address>; /** * @notice return vTokenFactory address * @return VTokenFactory address */ getVTokenFactory(): Promise<Address>; /** * @notice return Whitelist address * @return Whitelist address */ getWhitelist(): Promise<Address>; /** * @notice return MarginPool address * @return MarginPool address */ getMarginPool(): Promise<Address>; /** * @notice return MarginCalculator address * @return MarginCalculator address */ getMarginCalculator(): Promise<Address>; /** * @notice return LiquidationManager address * @return LiquidationManager address */ getLiquidationManager(): Promise<Address>; /** * @notice return Controller address * @return Controller address */ getController(): Promise<Address>; /** * @notice set Oracle address * @dev can only be called by the addressbook owner * @param owner Owner address * @param oracle Oracle address */ setOracle(owner: Wallet, oracle: Address): Promise<TransactionResponse>; /** * @notice set VToken implementation address * @dev can only be called by the addressbook owner * @param owner Owner address * @param vTokenImpl VToken implementation address */ setVTokenImpl(owner: Wallet, vTokenImpl: Address): Promise<TransactionResponse>; /** * @notice set VTokenFactory address * @dev can only be called by the addressbook owner * @param owner Owner address * @param vTokenFactory VTokenFactory address */ setVTokenFactory(owner: Wallet, vTokenFactory: Address): Promise<TransactionResponse>; /** * @notice set Whitelist address * @dev can only be called by the addressbook owner * @param owner Owner address * @param whitelist Whitelist address */ setWhitelist(owner: Wallet, whitelist: Address): Promise<TransactionResponse>; /** * @notice set MarginPool address * @dev can only be called by the addressbook owner * @param owner Owner address * @param marginPool MarginPool address */ setMarginPool(owner: Wallet, marginPool: Address): Promise<TransactionResponse>; /** * @notice set MarginCalculator address * @dev can only be called by the addressbook owner * @param owner Owner address * @param marginCalculator MarginCalculator address */ setMarginCalculator(owner: Wallet, marginCalculator: Address): Promise<TransactionResponse>; /** * @notice set LiquidationManager address * @dev can only be called by the addressbook owner * @param owner Owner address * @param liquidationManager LiquidationManager address */ setLiquidationManager(owner: Wallet, liquidationManager: Address): Promise<TransactionResponse>; /** * @notice set Controller address * @dev can only be called by the addressbook owner * @param owner Owner address * @param controller Controller address */ setController(owner: Wallet, controller: Address): Promise<TransactionResponse>; /** * @notice return an address for specific key * @param key key address * @return address */ getAddress(key: string): Promise<Address>; /** * @notice set a specific address for a specific key * @dev can only be called by the addressbook owner * @param owner Owner address * @param key key * @param address address */ setAddress(owner: Wallet, key: string, address: Address): Promise<TransactionResponse>; }