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

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

export interface TestRelayHubContract
  extends Truffle.Contract<TestRelayHubInstance> {
  "new"(
    _stakeManager: string,
    _penalizer: string,
    _batchGateway: string,
    _relayRegistrar: string,
    _config: {
      maxWorkerCount: number | BN | string;
      gasReserve: number | BN | string;
      postOverhead: number | BN | string;
      gasOverhead: number | BN | string;
      minimumUnstakeDelay: number | BN | string;
      devAddress: string;
      devFee: number | BN | string;
      baseRelayFee: number | BN | string;
      pctRelayFee: number | BN | string;
    },
    meta?: Truffle.TransactionDetails
  ): Promise<TestRelayHubInstance>;
}

export interface AbandonedRelayManagerBalanceEscheated {
  name: "AbandonedRelayManagerBalanceEscheated";
  args: {
    relayManager: string;
    balance: BN;
    0: string;
    1: BN;
  };
}

export interface Deposited {
  name: "Deposited";
  args: {
    paymaster: string;
    from: string;
    amount: BN;
    0: string;
    1: string;
    2: BN;
  };
}

export interface HubDeprecated {
  name: "HubDeprecated";
  args: {
    deprecationTime: BN;
    0: BN;
  };
}

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

export interface RelayHubConfigured {
  name: "RelayHubConfigured";
  args: {
    config: {
      maxWorkerCount: BN;
      gasReserve: BN;
      postOverhead: BN;
      gasOverhead: BN;
      minimumUnstakeDelay: BN;
      devAddress: string;
      devFee: BN;
      baseRelayFee: BN;
      pctRelayFee: BN;
    };
    0: {
      maxWorkerCount: BN;
      gasReserve: BN;
      postOverhead: BN;
      gasOverhead: BN;
      minimumUnstakeDelay: BN;
      devAddress: string;
      devFee: BN;
      baseRelayFee: BN;
      pctRelayFee: BN;
    };
  };
}

export interface RelayWorkersAdded {
  name: "RelayWorkersAdded";
  args: {
    relayManager: string;
    newRelayWorkers: string[];
    workersCount: BN;
    0: string;
    1: string[];
    2: BN;
  };
}

export interface StakingTokenDataChanged {
  name: "StakingTokenDataChanged";
  args: {
    token: string;
    minimumStake: BN;
    0: string;
    1: BN;
  };
}

export interface TransactionRejectedByPaymaster {
  name: "TransactionRejectedByPaymaster";
  args: {
    relayManager: string;
    paymaster: string;
    relayRequestID: string;
    from: string;
    to: string;
    relayWorker: string;
    selector: string;
    innerGasUsed: BN;
    reason: string;
    0: string;
    1: string;
    2: string;
    3: string;
    4: string;
    5: string;
    6: string;
    7: BN;
    8: string;
  };
}

export interface TransactionRelayed {
  name: "TransactionRelayed";
  args: {
    relayManager: string;
    relayWorker: string;
    relayRequestID: string;
    from: string;
    to: string;
    paymaster: string;
    selector: string;
    status: BN;
    charge: BN;
    0: string;
    1: string;
    2: string;
    3: string;
    4: string;
    5: string;
    6: string;
    7: BN;
    8: BN;
  };
}

export interface TransactionResult {
  name: "TransactionResult";
  args: {
    status: BN;
    returnValue: string;
    0: BN;
    1: string;
  };
}

export interface Withdrawn {
  name: "Withdrawn";
  args: {
    account: string;
    dest: string;
    amount: BN;
    0: string;
    1: string;
    2: BN;
  };
}

type AllEvents =
  | AbandonedRelayManagerBalanceEscheated
  | Deposited
  | HubDeprecated
  | OwnershipTransferred
  | RelayHubConfigured
  | RelayWorkersAdded
  | StakingTokenDataChanged
  | TransactionRejectedByPaymaster
  | TransactionRelayed
  | TransactionResult
  | Withdrawn;

export interface TestRelayHubInstance extends Truffle.ContractInstance {
  /**
   * Add new worker addresses controlled by the sender who must be a staked Relay Manager address. Emits a `RelayWorkersAdded` event. This function can be called multiple times, emitting new events.
   */
  addRelayWorkers: {
    (
      newRelayWorkers: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      newRelayWorkers: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      newRelayWorkers: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      newRelayWorkers: string[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

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

  /**
   */
  balanceOf(
    target: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  calculateCharge(
    gasUsed: number | BN | string,
    relayData: {
      maxFeePerGas: number | BN | string;
      maxPriorityFeePerGas: number | BN | string;
      transactionCalldataGasUsed: number | BN | string;
      relayWorker: string;
      paymaster: string;
      forwarder: string;
      paymasterData: string;
      clientId: number | BN | string;
    },
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   * The fee is expressed as a  percentage of the actual charge. For example, a value '40' stands for a 40% fee, so the Relay Manager will only get 60% of the `charge`.
   * @param charge The amount of Ether in wei the Paymaster will be charged for this transaction.
   */
  calculateDevCharge(
    charge: number | BN | string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   * Deprecate hub by reverting all incoming `relayCall()` calls starting from a given timestamp
   * @param _deprecationTime The timestamp in seconds after which the `RelayHub` stops serving transactions.
   */
  deprecateHub: {
    (
      _deprecationTime: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      _deprecationTime: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      _deprecationTime: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      _deprecationTime: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * @param relayManager
   */
  escheatAbandonedRelayBalance: {
    (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>;
  };

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

  /**
   */
  getConfiguration(
    txDetails?: Truffle.TransactionDetails
  ): Promise<{
    maxWorkerCount: BN;
    gasReserve: BN;
    postOverhead: BN;
    gasOverhead: BN;
    minimumUnstakeDelay: BN;
    devAddress: string;
    devFee: BN;
    baseRelayFee: BN;
    pctRelayFee: BN;
  }>;

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

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

  /**
   * @param token An address of an ERC-20 compatible tokens.
   */
  getMinimumStakePerToken(
    token: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

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

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

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

  /**
   * @param manager An address of the Relay Manager.
   */
  getWorkerCount(
    manager: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   * @param worker An address of the Relay Worker.
   */
  getWorkerManager(
    worker: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<string>;

  innerRelayCall: {
    (
      domainSeparatorName: string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      gasAndDataLimits: {
        acceptanceBudget: number | BN | string;
        preRelayedCallGasLimit: number | BN | string;
        postRelayedCallGasLimit: number | BN | string;
        calldataSizeLimit: number | BN | string;
      },
      totalInitialGas: number | BN | string,
      maxPossibleGas: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      domainSeparatorName: string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      gasAndDataLimits: {
        acceptanceBudget: number | BN | string;
        preRelayedCallGasLimit: number | BN | string;
        postRelayedCallGasLimit: number | BN | string;
        calldataSizeLimit: number | BN | string;
      },
      totalInitialGas: number | BN | string,
      maxPossibleGas: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{ 0: BN; 1: string }>;
    sendTransaction(
      domainSeparatorName: string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      gasAndDataLimits: {
        acceptanceBudget: number | BN | string;
        preRelayedCallGasLimit: number | BN | string;
        postRelayedCallGasLimit: number | BN | string;
        calldataSizeLimit: number | BN | string;
      },
      totalInitialGas: number | BN | string,
      maxPossibleGas: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      domainSeparatorName: string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      gasAndDataLimits: {
        acceptanceBudget: number | BN | string;
        preRelayedCallGasLimit: number | BN | string;
        postRelayedCallGasLimit: number | BN | string;
        calldataSizeLimit: number | BN | string;
      },
      totalInitialGas: number | BN | string,
      maxPossibleGas: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   */
  isDeprecated(txDetails?: Truffle.TransactionDetails): Promise<boolean>;

  /**
   * Uses `StakeManager` to 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>;

  /**
   * The `RelayRegistrar` callback to notify the `RelayHub` that this `relayManager` has updated registration.
   */
  onRelayServerRegistered: {
    (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>;
  };

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

  /**
   * In case the Relay Worker has been found to be in violation of some rules by the `Penalizer` contract, the `Penalizer` will call this method to execute a penalization. The `RelayHub` will look up the Relay Manager of the given Relay Worker and will forward the call to the `StakeManager` contract. The `RelayHub` does not perform the actual penalization either.
   * @param beneficiary The address that called the `Penalizer` and will receive a reward for it.
   * @param relayWorker The address of the Relay Worker that committed a penalizable offense.
   */
  penalize: {
    (
      relayWorker: string,
      beneficiary: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      relayWorker: string,
      beneficiary: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      relayWorker: string,
      beneficiary: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      relayWorker: string,
      beneficiary: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  relayCall: {
    (
      domainSeparatorName: string,
      maxAcceptanceBudget: number | BN | string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      domainSeparatorName: string,
      maxAcceptanceBudget: number | BN | string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{ 0: boolean; 1: BN; 2: BN; 3: string }>;
    sendTransaction(
      domainSeparatorName: string,
      maxAcceptanceBudget: number | BN | string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      domainSeparatorName: string,
      maxAcceptanceBudget: number | BN | string,
      relayRequest: {
        request: {
          from: string;
          to: string;
          value: number | BN | string;
          gas: number | BN | string;
          nonce: number | BN | string;
          data: string;
          validUntilTime: number | BN | string;
        };
        relayData: {
          maxFeePerGas: number | BN | string;
          maxPriorityFeePerGas: number | BN | string;
          transactionCalldataGasUsed: number | BN | string;
          relayWorker: string;
          paymaster: string;
          forwarder: string;
          paymasterData: string;
          clientId: number | BN | string;
        };
      },
      signature: string,
      approvalData: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

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

  setConfiguration: {
    (
      _config: {
        maxWorkerCount: number | BN | string;
        gasReserve: number | BN | string;
        postOverhead: number | BN | string;
        gasOverhead: number | BN | string;
        minimumUnstakeDelay: number | BN | string;
        devAddress: string;
        devFee: number | BN | string;
        baseRelayFee: number | BN | string;
        pctRelayFee: number | BN | string;
      },
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      _config: {
        maxWorkerCount: number | BN | string;
        gasReserve: number | BN | string;
        postOverhead: number | BN | string;
        gasOverhead: number | BN | string;
        minimumUnstakeDelay: number | BN | string;
        devAddress: string;
        devFee: number | BN | string;
        baseRelayFee: number | BN | string;
        pctRelayFee: number | BN | string;
      },
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      _config: {
        maxWorkerCount: number | BN | string;
        gasReserve: number | BN | string;
        postOverhead: number | BN | string;
        gasOverhead: number | BN | string;
        minimumUnstakeDelay: number | BN | string;
        devAddress: string;
        devFee: number | BN | string;
        baseRelayFee: number | BN | string;
        pctRelayFee: number | BN | string;
      },
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      _config: {
        maxWorkerCount: number | BN | string;
        gasReserve: number | BN | string;
        postOverhead: number | BN | string;
        gasOverhead: number | BN | string;
        minimumUnstakeDelay: number | BN | string;
        devAddress: string;
        devFee: number | BN | string;
        baseRelayFee: number | BN | string;
        pctRelayFee: number | BN | string;
      },
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Sets or changes the minimum amount of a given `token` that needs to be staked so that the Relay Manager is considered to be 'staked' by this `RelayHub`. Zero value means this token is not allowed for staking.
   * @param minimumStake An array of minimal amounts necessary for a corresponding token, in wei.
   * @param token An array of addresses of ERC-20 compatible tokens.
   */
  setMinimumStakes: {
    (
      token: string[],
      minimumStake: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      token: string[],
      minimumStake: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      token: string[],
      minimumStake: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      token: string[],
      minimumStake: (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>;

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

  /**
   * Uses `StakeManager` to decide if the Relay Manager can be considered staked or not. Returns if the stake's token, amount and delay satisfy all requirements, reverts otherwise.
   */
  verifyRelayManagerStaked(
    relayManager: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<void>;

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

  /**
   * Withdraws from an account's balance, sending it back to the caller. Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding. Emits a `Withdrawn` event.
   */
  withdraw: {
    (
      dest: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      dest: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      dest: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      dest: string,
      amount: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Withdraws from an account's balance, sending funds to multiple provided addresses. Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding. Emits a `Withdrawn` event for each destination.
   */
  withdrawMultiple: {
    (
      dest: string[],
      amount: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      dest: string[],
      amount: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      dest: string[],
      amount: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      dest: string[],
      amount: (number | BN | string)[],
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Allow depositing for non-paymaster addresses for Gas Calculations tests
   */
  depositFor: {
    (target: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(target: string, txDetails?: Truffle.TransactionDetails): Promise<void>;
    sendTransaction(
      target: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      target: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  methods: {
    /**
     * Add new worker addresses controlled by the sender who must be a staked Relay Manager address. Emits a `RelayWorkersAdded` event. This function can be called multiple times, emitting new events.
     */
    addRelayWorkers: {
      (
        newRelayWorkers: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        newRelayWorkers: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        newRelayWorkers: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        newRelayWorkers: string[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

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

    /**
     */
    balanceOf(
      target: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    calculateCharge(
      gasUsed: number | BN | string,
      relayData: {
        maxFeePerGas: number | BN | string;
        maxPriorityFeePerGas: number | BN | string;
        transactionCalldataGasUsed: number | BN | string;
        relayWorker: string;
        paymaster: string;
        forwarder: string;
        paymasterData: string;
        clientId: number | BN | string;
      },
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     * The fee is expressed as a  percentage of the actual charge. For example, a value '40' stands for a 40% fee, so the Relay Manager will only get 60% of the `charge`.
     * @param charge The amount of Ether in wei the Paymaster will be charged for this transaction.
     */
    calculateDevCharge(
      charge: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     * Deprecate hub by reverting all incoming `relayCall()` calls starting from a given timestamp
     * @param _deprecationTime The timestamp in seconds after which the `RelayHub` stops serving transactions.
     */
    deprecateHub: {
      (
        _deprecationTime: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        _deprecationTime: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        _deprecationTime: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        _deprecationTime: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * @param relayManager
     */
    escheatAbandonedRelayBalance: {
      (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>;
    };

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

    /**
     */
    getConfiguration(
      txDetails?: Truffle.TransactionDetails
    ): Promise<{
      maxWorkerCount: BN;
      gasReserve: BN;
      postOverhead: BN;
      gasOverhead: BN;
      minimumUnstakeDelay: BN;
      devAddress: string;
      devFee: BN;
      baseRelayFee: BN;
      pctRelayFee: BN;
    }>;

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

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

    /**
     * @param token An address of an ERC-20 compatible tokens.
     */
    getMinimumStakePerToken(
      token: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

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

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

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

    /**
     * @param manager An address of the Relay Manager.
     */
    getWorkerCount(
      manager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     * @param worker An address of the Relay Worker.
     */
    getWorkerManager(
      worker: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;

    innerRelayCall: {
      (
        domainSeparatorName: string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        gasAndDataLimits: {
          acceptanceBudget: number | BN | string;
          preRelayedCallGasLimit: number | BN | string;
          postRelayedCallGasLimit: number | BN | string;
          calldataSizeLimit: number | BN | string;
        },
        totalInitialGas: number | BN | string,
        maxPossibleGas: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        domainSeparatorName: string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        gasAndDataLimits: {
          acceptanceBudget: number | BN | string;
          preRelayedCallGasLimit: number | BN | string;
          postRelayedCallGasLimit: number | BN | string;
          calldataSizeLimit: number | BN | string;
        },
        totalInitialGas: number | BN | string,
        maxPossibleGas: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<{ 0: BN; 1: string }>;
      sendTransaction(
        domainSeparatorName: string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        gasAndDataLimits: {
          acceptanceBudget: number | BN | string;
          preRelayedCallGasLimit: number | BN | string;
          postRelayedCallGasLimit: number | BN | string;
          calldataSizeLimit: number | BN | string;
        },
        totalInitialGas: number | BN | string,
        maxPossibleGas: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        domainSeparatorName: string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        gasAndDataLimits: {
          acceptanceBudget: number | BN | string;
          preRelayedCallGasLimit: number | BN | string;
          postRelayedCallGasLimit: number | BN | string;
          calldataSizeLimit: number | BN | string;
        },
        totalInitialGas: number | BN | string,
        maxPossibleGas: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     */
    isDeprecated(txDetails?: Truffle.TransactionDetails): Promise<boolean>;

    /**
     * Uses `StakeManager` to 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>;

    /**
     * The `RelayRegistrar` callback to notify the `RelayHub` that this `relayManager` has updated registration.
     */
    onRelayServerRegistered: {
      (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>;
    };

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

    /**
     * In case the Relay Worker has been found to be in violation of some rules by the `Penalizer` contract, the `Penalizer` will call this method to execute a penalization. The `RelayHub` will look up the Relay Manager of the given Relay Worker and will forward the call to the `StakeManager` contract. The `RelayHub` does not perform the actual penalization either.
     * @param beneficiary The address that called the `Penalizer` and will receive a reward for it.
     * @param relayWorker The address of the Relay Worker that committed a penalizable offense.
     */
    penalize: {
      (
        relayWorker: string,
        beneficiary: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        relayWorker: string,
        beneficiary: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        relayWorker: string,
        beneficiary: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        relayWorker: string,
        beneficiary: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    relayCall: {
      (
        domainSeparatorName: string,
        maxAcceptanceBudget: number | BN | string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        domainSeparatorName: string,
        maxAcceptanceBudget: number | BN | string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<{ 0: boolean; 1: BN; 2: BN; 3: string }>;
      sendTransaction(
        domainSeparatorName: string,
        maxAcceptanceBudget: number | BN | string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        domainSeparatorName: string,
        maxAcceptanceBudget: number | BN | string,
        relayRequest: {
          request: {
            from: string;
            to: string;
            value: number | BN | string;
            gas: number | BN | string;
            nonce: number | BN | string;
            data: string;
            validUntilTime: number | BN | string;
          };
          relayData: {
            maxFeePerGas: number | BN | string;
            maxPriorityFeePerGas: number | BN | string;
            transactionCalldataGasUsed: number | BN | string;
            relayWorker: string;
            paymaster: string;
            forwarder: string;
            paymasterData: string;
            clientId: number | BN | string;
          };
        },
        signature: string,
        approvalData: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

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

    setConfiguration: {
      (
        _config: {
          maxWorkerCount: number | BN | string;
          gasReserve: number | BN | string;
          postOverhead: number | BN | string;
          gasOverhead: number | BN | string;
          minimumUnstakeDelay: number | BN | string;
          devAddress: string;
          devFee: number | BN | string;
          baseRelayFee: number | BN | string;
          pctRelayFee: number | BN | string;
        },
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        _config: {
          maxWorkerCount: number | BN | string;
          gasReserve: number | BN | string;
          postOverhead: number | BN | string;
          gasOverhead: number | BN | string;
          minimumUnstakeDelay: number | BN | string;
          devAddress: string;
          devFee: number | BN | string;
          baseRelayFee: number | BN | string;
          pctRelayFee: number | BN | string;
        },
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        _config: {
          maxWorkerCount: number | BN | string;
          gasReserve: number | BN | string;
          postOverhead: number | BN | string;
          gasOverhead: number | BN | string;
          minimumUnstakeDelay: number | BN | string;
          devAddress: string;
          devFee: number | BN | string;
          baseRelayFee: number | BN | string;
          pctRelayFee: number | BN | string;
        },
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        _config: {
          maxWorkerCount: number | BN | string;
          gasReserve: number | BN | string;
          postOverhead: number | BN | string;
          gasOverhead: number | BN | string;
          minimumUnstakeDelay: number | BN | string;
          devAddress: string;
          devFee: number | BN | string;
          baseRelayFee: number | BN | string;
          pctRelayFee: number | BN | string;
        },
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Sets or changes the minimum amount of a given `token` that needs to be staked so that the Relay Manager is considered to be 'staked' by this `RelayHub`. Zero value means this token is not allowed for staking.
     * @param minimumStake An array of minimal amounts necessary for a corresponding token, in wei.
     * @param token An array of addresses of ERC-20 compatible tokens.
     */
    setMinimumStakes: {
      (
        token: string[],
        minimumStake: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        token: string[],
        minimumStake: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        token: string[],
        minimumStake: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        token: string[],
        minimumStake: (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>;

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

    /**
     * Uses `StakeManager` to decide if the Relay Manager can be considered staked or not. Returns if the stake's token, amount and delay satisfy all requirements, reverts otherwise.
     */
    verifyRelayManagerStaked(
      relayManager: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;

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

    /**
     * Withdraws from an account's balance, sending it back to the caller. Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding. Emits a `Withdrawn` event.
     */
    withdraw: {
      (
        dest: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        dest: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        dest: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        dest: string,
        amount: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Withdraws from an account's balance, sending funds to multiple provided addresses. Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding. Emits a `Withdrawn` event for each destination.
     */
    withdrawMultiple: {
      (
        dest: string[],
        amount: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        dest: string[],
        amount: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        dest: string[],
        amount: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        dest: string[],
        amount: (number | BN | string)[],
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Allow depositing for non-paymaster addresses for Gas Calculations tests
     */
    depositFor: {
      (target: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        target: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        target: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        target: 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[]>;
}
