/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import BN from "bn.js";
import { EventData, PastEventOptions } from "web3-eth-contract";

export interface RelayRegistrarContract
  extends Truffle.Contract<RelayRegistrarInstance> {
  "new"(
    _relayRegistrationMaxAge: number | BN | string,
    meta?: Truffle.TransactionDetails
  ): Promise<RelayRegistrarInstance>;
}

export interface OwnershipTransferred {
  name: "OwnershipTransferred";
  args: {
    previousOwner: string;
    newOwner: string;
    0: string;
    1: string;
  };
}

export interface RelayServerRegistered {
  name: "RelayServerRegistered";
  args: {
    relayManager: string;
    relayHub: string;
    relayUrl: string[];
    0: string;
    1: string;
    2: string[];
  };
}

type AllEvents = OwnershipTransferred | RelayServerRegistered;

export interface RelayRegistrarInstance extends Truffle.ContractInstance {
  /**
   * Returns the address of the current owner.
   */
  owner(txDetails?: Truffle.TransactionDetails): Promise<string>;

  /**
   * Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
   */
  renounceOwnership: {
    (txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(txDetails?: Truffle.TransactionDetails): Promise<void>;
    sendTransaction(txDetails?: Truffle.TransactionDetails): Promise<string>;
    estimateGas(txDetails?: Truffle.TransactionDetails): Promise<number>;
  };

  /**
   * Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
   */
  transferOwnership: {
    (newOwner: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      newOwner: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      newOwner: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      newOwner: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   */
  getCreationBlock(txDetails?: Truffle.TransactionDetails): Promise<BN>;

  /**
   */
  getRelayRegistrationMaxAge(
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   * Change the maximum relay registration age.
   */
  setRelayRegistrationMaxAge: {
    (
      _relayRegistrationMaxAge: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      _relayRegistrationMaxAge: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      _relayRegistrationMaxAge: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      _relayRegistrationMaxAge: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
   */
  supportsInterface(
    interfaceId: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<boolean>;

  /**
   * This function is called by Relay Servers in order to register or to update their registration.
   * @param relayHub The address of the `RelayHub` contract for which this action is performed.
   * @param url The URL of the Relay Server that is listening to the clients' requests.
   */
  registerRelayServer: {
    (
      relayHub: string,
      url: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      relayHub: string,
      url: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayHub: string,
      url: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayHub: string,
      url: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * @param relayHub The address of the `RelayHub` contract for which this action is performed.
   * @param relayManager An address of a Relay Manager.
   */
  getRelayInfo(
    relayHub: string,
    relayManager: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<{
    lastSeenBlockNumber: BN;
    lastSeenTimestamp: BN;
    firstSeenBlockNumber: BN;
    firstSeenTimestamp: BN;
    urlParts: string[];
    relayManager: string;
  }>;

  /**
   * Read relay info of registered Relay Server from an on-chain storage.
   * @param relayHub The address of the `RelayHub` contract for which this action is performed.
   */
  readRelayInfos(
    relayHub: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<
    {
      lastSeenBlockNumber: BN;
      lastSeenTimestamp: BN;
      firstSeenBlockNumber: BN;
      firstSeenTimestamp: BN;
      urlParts: string[];
      relayManager: string;
    }[]
  >;

  /**
   * Read relay info of registered Relay Server from an on-chain storage.
   * @param maxCount The maximum amount of relays to be returned by this function.
   * @param oldestBlockNumber The latest block number in which a Relay Server may be registered.
   * @param oldestBlockTimestamp The latest block timestamp in which a Relay Server may be registered.
   * @param relayHub The address of the `RelayHub` contract for which this action is performed.
   */
  readRelayInfosInRange(
    relayHub: string,
    oldestBlockNumber: number | BN | string,
    oldestBlockTimestamp: number | BN | string,
    maxCount: number | BN | string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<
    {
      lastSeenBlockNumber: BN;
      lastSeenTimestamp: BN;
      firstSeenBlockNumber: BN;
      firstSeenTimestamp: BN;
      urlParts: string[];
      relayManager: string;
    }[]
  >;

  methods: {
    /**
     * Returns the address of the current owner.
     */
    owner(txDetails?: Truffle.TransactionDetails): Promise<string>;

    /**
     * Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
     */
    renounceOwnership: {
      (txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(txDetails?: Truffle.TransactionDetails): Promise<void>;
      sendTransaction(txDetails?: Truffle.TransactionDetails): Promise<string>;
      estimateGas(txDetails?: Truffle.TransactionDetails): Promise<number>;
    };

    /**
     * Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
     */
    transferOwnership: {
      (newOwner: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        newOwner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        newOwner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        newOwner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     */
    getCreationBlock(txDetails?: Truffle.TransactionDetails): Promise<BN>;

    /**
     */
    getRelayRegistrationMaxAge(
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     * Change the maximum relay registration age.
     */
    setRelayRegistrationMaxAge: {
      (
        _relayRegistrationMaxAge: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        _relayRegistrationMaxAge: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        _relayRegistrationMaxAge: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        _relayRegistrationMaxAge: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
     */
    supportsInterface(
      interfaceId: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<boolean>;

    /**
     * This function is called by Relay Servers in order to register or to update their registration.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @param url The URL of the Relay Server that is listening to the clients' requests.
     */
    registerRelayServer: {
      (
        relayHub: string,
        url: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        relayHub: string,
        url: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayHub: string,
        url: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayHub: string,
        url: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @param relayManager An address of a Relay Manager.
     */
    getRelayInfo(
      relayHub: string,
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{
      lastSeenBlockNumber: BN;
      lastSeenTimestamp: BN;
      firstSeenBlockNumber: BN;
      firstSeenTimestamp: BN;
      urlParts: string[];
      relayManager: string;
    }>;

    /**
     * Read relay info of registered Relay Server from an on-chain storage.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     */
    readRelayInfos(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<
      {
        lastSeenBlockNumber: BN;
        lastSeenTimestamp: BN;
        firstSeenBlockNumber: BN;
        firstSeenTimestamp: BN;
        urlParts: string[];
        relayManager: string;
      }[]
    >;

    /**
     * Read relay info of registered Relay Server from an on-chain storage.
     * @param maxCount The maximum amount of relays to be returned by this function.
     * @param oldestBlockNumber The latest block number in which a Relay Server may be registered.
     * @param oldestBlockTimestamp The latest block timestamp in which a Relay Server may be registered.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     */
    readRelayInfosInRange(
      relayHub: string,
      oldestBlockNumber: number | BN | string,
      oldestBlockTimestamp: number | BN | string,
      maxCount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<
      {
        lastSeenBlockNumber: BN;
        lastSeenTimestamp: BN;
        firstSeenBlockNumber: BN;
        firstSeenTimestamp: BN;
        urlParts: string[];
        relayManager: string;
      }[]
    >;
  };

  getPastEvents(event: string): Promise<EventData[]>;
  getPastEvents(
    event: string,
    options: PastEventOptions,
    callback: (error: Error, event: EventData) => void
  ): Promise<EventData[]>;
  getPastEvents(event: string, options: PastEventOptions): Promise<EventData[]>;
  getPastEvents(
    event: string,
    callback: (error: Error, event: EventData) => void
  ): Promise<EventData[]>;
}
