import BigNumber from 'bignumber.js'; import Web3 from 'web3'; import { Contract } from 'web3-eth-contract'; import { CallOptions, SendOptions, MakerOracleMessage, TxResult, address, BigNumberable, Price } from '../lib/types'; import { Contracts } from '../modules/Contracts'; /** * Used to read and update the Maker Oracle V2 Medianizer contract. */ export declare class Relayer { static relayers: { [address: string]: Relayer; }; protected contracts: Contracts; protected web3: Web3; protected oracle: Contract; static fromAddress(contracts: Contracts, web3: Web3, address: string): Relayer; constructor(contracts: Contracts, web3: Web3, oracle?: Contract); get address(): string; /** * Get the timestamp of the latest update. */ getAge(options?: CallOptions): Promise; /** * Get the number of required signatures to update the oracle. */ getBar(options?: CallOptions): Promise; /** * Get whether an address is authorized to sign price messages. */ getOrcl(signer: address, options?: CallOptions): Promise; /** * Get whether an address is authorized to read the oracle price. */ getBud(signer: address, options?: CallOptions): Promise; /** * Get a signer address, given the signer ID (value of the first byte of the address). */ getSlot(signerId: BigNumberable, options?: CallOptions): Promise
; /** * Get the value of the latest update, and a boolean indicating whether the price is nonzero. * * Must be called from an account with permission to read the oracle. */ peek(options?: CallOptions): Promise<[BigNumber, boolean]>; /** * Get the value of the latest update. Throws if the price is zero. * * Must be called from an account with permission to read the oracle. */ getValue(options?: CallOptions): Promise; /** * Get the value of the latest update. Throws if the price is zero. * * Returns a Price object, which accounts for the on-chain 18 decimals fixed-point representation. * Must be called from an account with permission to read the oracle. */ getPrice(options?: CallOptions): Promise; getPrivateValue(): Promise<{ age: BigNumber; value: BigNumber; }>; getPrivatePrice(): Promise<{ age: BigNumber; price: Price; }>; /** * Update the oracle. */ poke(messages: MakerOracleMessage[], options?: SendOptions): Promise; /** * Authorize new signers. */ lift(signers: address[], options?: SendOptions): Promise; /** * Unauthorize new signers. */ drop(signers: address[], options?: SendOptions): Promise; /** * Set the required number of signers to update the price. */ setBar(newBar: BigNumberable, options?: SendOptions): Promise; /** * Authorize addresses to read the oracle price. */ kiss(readers: address | address[], options?: SendOptions): Promise; /** * Unauthorize addresses so they can no longer read the oracle price. */ diss(readers: address | address[], options?: SendOptions): Promise; }