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

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

export interface StakeManagerContract
  extends Truffle.Contract<StakeManagerInstance> {
  "new"(
    _maxUnstakeDelay: number | BN | string,
    _abandonmentDelay: number | BN | string,
    _escheatmentDelay: number | BN | string,
    _burnAddress: string,
    _devAddress: string,
    meta?: Truffle.TransactionDetails
  ): Promise<StakeManagerInstance>;
}

export interface AbandonedRelayManagerStakeEscheated {
  name: "AbandonedRelayManagerStakeEscheated";
  args: {
    relayManager: string;
    owner: string;
    token: string;
    amount: BN;
    0: string;
    1: string;
    2: string;
    3: BN;
  };
}

export interface BurnAddressSet {
  name: "BurnAddressSet";
  args: {
    burnAddress: string;
    0: string;
  };
}

export interface DevAddressSet {
  name: "DevAddressSet";
  args: {
    devAddress: string;
    0: string;
  };
}

export interface HubAuthorized {
  name: "HubAuthorized";
  args: {
    relayManager: string;
    relayHub: string;
    0: string;
    1: string;
  };
}

export interface HubUnauthorized {
  name: "HubUnauthorized";
  args: {
    relayManager: string;
    relayHub: string;
    removalTime: BN;
    0: string;
    1: string;
    2: BN;
  };
}

export interface OwnerSet {
  name: "OwnerSet";
  args: {
    relayManager: string;
    owner: string;
    0: string;
    1: string;
  };
}

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

export interface RelayServerAbandoned {
  name: "RelayServerAbandoned";
  args: {
    relayManager: string;
    abandonedTime: BN;
    0: string;
    1: BN;
  };
}

export interface RelayServerKeepalive {
  name: "RelayServerKeepalive";
  args: {
    relayManager: string;
    keepaliveTime: BN;
    0: string;
    1: BN;
  };
}

export interface StakeAdded {
  name: "StakeAdded";
  args: {
    relayManager: string;
    owner: string;
    token: string;
    stake: BN;
    unstakeDelay: BN;
    0: string;
    1: string;
    2: string;
    3: BN;
    4: BN;
  };
}

export interface StakePenalized {
  name: "StakePenalized";
  args: {
    relayManager: string;
    beneficiary: string;
    token: string;
    reward: BN;
    0: string;
    1: string;
    2: string;
    3: BN;
  };
}

export interface StakeUnlocked {
  name: "StakeUnlocked";
  args: {
    relayManager: string;
    owner: string;
    withdrawTime: BN;
    0: string;
    1: string;
    2: BN;
  };
}

export interface StakeWithdrawn {
  name: "StakeWithdrawn";
  args: {
    relayManager: string;
    owner: string;
    token: string;
    amount: BN;
    0: string;
    1: string;
    2: string;
    3: BN;
  };
}

type AllEvents =
  | AbandonedRelayManagerStakeEscheated
  | BurnAddressSet
  | DevAddressSet
  | HubAuthorized
  | HubUnauthorized
  | OwnerSet
  | OwnershipTransferred
  | RelayServerAbandoned
  | RelayServerKeepalive
  | StakeAdded
  | StakePenalized
  | StakeUnlocked
  | StakeWithdrawn;

export interface StakeManagerInstance extends Truffle.ContractInstance {
  /**
   * maps relay managers to a map of addressed of their authorized hubs to the information on that hub
   */
  authorizedHubs(
    arg0: string,
    arg1: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   * 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>;
  };

  /**
   * maps relay managers to their stakes
   */
  stakes(
    arg0: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<{ 0: BN; 1: BN; 2: BN; 3: BN; 4: BN; 5: string; 6: string }>;

  /**
   * 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>;
  };

  versionSM(txDetails?: Truffle.TransactionDetails): Promise<string>;

  /**
   * Get the stake details information for the given Relay Manager.
   * @param relayManager The address of a Relay Manager.
   */
  getStakeInfo(
    relayManager: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<{
    0: {
      stake: BN;
      unstakeDelay: BN;
      withdrawTime: BN;
      abandonedTime: BN;
      keepaliveTime: BN;
      token: string;
      owner: string;
    };
    1: boolean;
  }>;

  /**
   * Change the address that will receive the 'burned' part of the penalized stake. This is done to prevent malicious Relay Server from penalizing itself and breaking even.
   */
  setBurnAddress: {
    (_burnAddress: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      _burnAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      _burnAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      _burnAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   */
  getBurnAddress(txDetails?: Truffle.TransactionDetails): Promise<string>;

  /**
   * Change the address that will receive the 'abandoned' stake. This is done to prevent Relay Servers that lost their keys from losing access to funds.
   */
  setDevAddress: {
    (_devAddress: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      _devAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      _devAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      _devAddress: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   */
  getAbandonedRelayServerConfig(
    txDetails?: Truffle.TransactionDetails
  ): Promise<{
    devAddress: string;
    abandonmentDelay: BN;
    escheatmentDelay: BN;
  }>;

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

  /**
   * 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>;

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

  /**
   * Set the owner of a Relay Manager. Called only by the RelayManager itself. Note that owners cannot transfer ownership - if the entry already exists, reverts.
   * @param owner - owner of the relay (as configured off-chain)
   */
  setRelayManagerOwner: {
    (owner: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(owner: string, txDetails?: Truffle.TransactionDetails): Promise<void>;
    sendTransaction(
      owner: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      owner: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Put a stake for a relayManager and set its unstake delay. Only the owner can call this function. If the entry does not exist, reverts. The owner must give allowance of the ERC-20 token to the StakeManager before calling this method. It is the RelayHub who has a configurable list of minimum stakes per token. StakeManager accepts all tokens.
   * @param amount The amount of tokens to be taken from the relayOwner and locked in the StakeManager as a stake
   * @param relayManager The address that represents a stake entry and controls relay registrations on relay hubs
   * @param token The address of an ERC-20 token that is used by the relayManager as a stake
   * @param unstakeDelay The number of seconds to elapse before an owner can retrieve the stake after calling `unlock`
   */
  stakeForRelayManager: {
    (
      token: string,
      relayManager: string,
      unstakeDelay: number | BN | string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      token: string,
      relayManager: string,
      unstakeDelay: number | BN | string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      token: string,
      relayManager: string,
      unstakeDelay: number | BN | string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      token: string,
      relayManager: string,
      unstakeDelay: number | BN | string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Schedule the unlocking of the stake. The `unstakeDelay` must pass before owner can call `withdrawStake`.
   * @param relayManager The address of a Relay Manager whose stake is to be unlocked.
   */
  unlockStake: {
    (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Withdraw the unlocked stake.
   * @param relayManager The address of a Relay Manager whose stake is to be withdrawn.
   */
  withdrawStake: {
    (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Add the `RelayHub` to a list of authorized by this Relay Manager. This allows the RelayHub to penalize this Relay Manager. The `RelayHub` cannot trust a Relay it cannot penalize.
   * @param relayHub The address of a `RelayHub` to be authorized.
   * @param relayManager The address of a Relay Manager whose stake is to be authorized for the new `RelayHub`.
   */
  authorizeHubByOwner: {
    (
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Same as `authorizeHubByOwner` but can be called by the RelayManager itself.
   */
  authorizeHubByManager: {
    (relayHub: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Remove the `RelayHub` from a list of authorized by this Relay Manager.
   * @param relayHub The address of a `RelayHub` to be unauthorized.
   * @param relayManager The address of a Relay Manager.
   */
  unauthorizeHubByOwner: {
    (
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Same as `unauthorizeHubByOwner` but can be called by the RelayManager itself.
   */
  unauthorizeHubByManager: {
    (relayHub: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayHub: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Slash the stake of the relay relayManager. In order to prevent stake kidnapping, burns part of stake on the way.
   * @param amount A total amount of penalty to be withdrawn from stake.
   * @param beneficiary The address that receives part of the penalty amount.
   * @param relayManager The address of a Relay Manager to be penalized.
   */
  penalizeRelayManager: {
    (
      relayManager: string,
      beneficiary: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      relayManager: string,
      beneficiary: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      beneficiary: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      beneficiary: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Check if the Relay Manager can be considered abandoned or not. Returns true if the stake's abandonment time is in the past including the escheatment delay, false otherwise.
   */
  isRelayEscheatable(
    relayManager: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<boolean>;

  /**
   * Allows the contract owner to set the given `relayManager` as abandoned after a configurable delay. Its entire stake and balance will be taken from a relay if it does not respond to being marked as abandoned.
   */
  markRelayAbandoned: {
    (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * If more than `abandonmentDelay` has passed since the last Keepalive transaction, and relay manager has been marked as abandoned, and after that more that `escheatmentDelay` have passed, entire stake and balance will be taken from this relay.
   */
  escheatAbandonedRelayStake: {
    (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Sets a new `keepaliveTime` for the given `relayManager`, preventing it from being marked as abandoned. Can be called by an authorized `RelayHub` or by the `relayOwner` address.
   */
  updateRelayKeepaliveTime: {
    (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  methods: {
    /**
     * maps relay managers to a map of addressed of their authorized hubs to the information on that hub
     */
    authorizedHubs(
      arg0: string,
      arg1: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     * 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>;
    };

    /**
     * maps relay managers to their stakes
     */
    stakes(
      arg0: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{ 0: BN; 1: BN; 2: BN; 3: BN; 4: BN; 5: string; 6: string }>;

    /**
     * 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>;
    };

    versionSM(txDetails?: Truffle.TransactionDetails): Promise<string>;

    /**
     * Get the stake details information for the given Relay Manager.
     * @param relayManager The address of a Relay Manager.
     */
    getStakeInfo(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{
      0: {
        stake: BN;
        unstakeDelay: BN;
        withdrawTime: BN;
        abandonedTime: BN;
        keepaliveTime: BN;
        token: string;
        owner: string;
      };
      1: boolean;
    }>;

    /**
     * Change the address that will receive the 'burned' part of the penalized stake. This is done to prevent malicious Relay Server from penalizing itself and breaking even.
     */
    setBurnAddress: {
      (_burnAddress: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        _burnAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        _burnAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        _burnAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     */
    getBurnAddress(txDetails?: Truffle.TransactionDetails): Promise<string>;

    /**
     * Change the address that will receive the 'abandoned' stake. This is done to prevent Relay Servers that lost their keys from losing access to funds.
     */
    setDevAddress: {
      (_devAddress: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        _devAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        _devAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        _devAddress: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     */
    getAbandonedRelayServerConfig(
      txDetails?: Truffle.TransactionDetails
    ): Promise<{
      devAddress: string;
      abandonmentDelay: BN;
      escheatmentDelay: BN;
    }>;

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

    /**
     * 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>;

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

    /**
     * Set the owner of a Relay Manager. Called only by the RelayManager itself. Note that owners cannot transfer ownership - if the entry already exists, reverts.
     * @param owner - owner of the relay (as configured off-chain)
     */
    setRelayManagerOwner: {
      (owner: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        owner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        owner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        owner: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Put a stake for a relayManager and set its unstake delay. Only the owner can call this function. If the entry does not exist, reverts. The owner must give allowance of the ERC-20 token to the StakeManager before calling this method. It is the RelayHub who has a configurable list of minimum stakes per token. StakeManager accepts all tokens.
     * @param amount The amount of tokens to be taken from the relayOwner and locked in the StakeManager as a stake
     * @param relayManager The address that represents a stake entry and controls relay registrations on relay hubs
     * @param token The address of an ERC-20 token that is used by the relayManager as a stake
     * @param unstakeDelay The number of seconds to elapse before an owner can retrieve the stake after calling `unlock`
     */
    stakeForRelayManager: {
      (
        token: string,
        relayManager: string,
        unstakeDelay: number | BN | string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        token: string,
        relayManager: string,
        unstakeDelay: number | BN | string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        token: string,
        relayManager: string,
        unstakeDelay: number | BN | string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        token: string,
        relayManager: string,
        unstakeDelay: number | BN | string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Schedule the unlocking of the stake. The `unstakeDelay` must pass before owner can call `withdrawStake`.
     * @param relayManager The address of a Relay Manager whose stake is to be unlocked.
     */
    unlockStake: {
      (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Withdraw the unlocked stake.
     * @param relayManager The address of a Relay Manager whose stake is to be withdrawn.
     */
    withdrawStake: {
      (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Add the `RelayHub` to a list of authorized by this Relay Manager. This allows the RelayHub to penalize this Relay Manager. The `RelayHub` cannot trust a Relay it cannot penalize.
     * @param relayHub The address of a `RelayHub` to be authorized.
     * @param relayManager The address of a Relay Manager whose stake is to be authorized for the new `RelayHub`.
     */
    authorizeHubByOwner: {
      (
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Same as `authorizeHubByOwner` but can be called by the RelayManager itself.
     */
    authorizeHubByManager: {
      (relayHub: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Remove the `RelayHub` from a list of authorized by this Relay Manager.
     * @param relayHub The address of a `RelayHub` to be unauthorized.
     * @param relayManager The address of a Relay Manager.
     */
    unauthorizeHubByOwner: {
      (
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Same as `unauthorizeHubByOwner` but can be called by the RelayManager itself.
     */
    unauthorizeHubByManager: {
      (relayHub: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayHub: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Slash the stake of the relay relayManager. In order to prevent stake kidnapping, burns part of stake on the way.
     * @param amount A total amount of penalty to be withdrawn from stake.
     * @param beneficiary The address that receives part of the penalty amount.
     * @param relayManager The address of a Relay Manager to be penalized.
     */
    penalizeRelayManager: {
      (
        relayManager: string,
        beneficiary: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        relayManager: string,
        beneficiary: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        beneficiary: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        beneficiary: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Check if the Relay Manager can be considered abandoned or not. Returns true if the stake's abandonment time is in the past including the escheatment delay, false otherwise.
     */
    isRelayEscheatable(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<boolean>;

    /**
     * Allows the contract owner to set the given `relayManager` as abandoned after a configurable delay. Its entire stake and balance will be taken from a relay if it does not respond to being marked as abandoned.
     */
    markRelayAbandoned: {
      (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * If more than `abandonmentDelay` has passed since the last Keepalive transaction, and relay manager has been marked as abandoned, and after that more that `escheatmentDelay` have passed, entire stake and balance will be taken from this relay.
     */
    escheatAbandonedRelayStake: {
      (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Sets a new `keepaliveTime` for the given `relayManager`, preventing it from being marked as abandoned. Can be called by an authorized `RelayHub` or by the `relayOwner` address.
     */
    updateRelayKeepaliveTime: {
      (relayManager: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayManager: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };
  };

  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[]>;
}
