/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
  BigNumber,
  BigNumberish,
  BytesLike,
  CallOverrides,
  ContractTransaction,
  Overrides,
  PayableOverrides,
  PopulatedTransaction,
  Signer,
  utils,
} from "ethers";
import type {
  FunctionFragment,
  Result,
  EventFragment,
} from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
  TypedEventFilter,
  TypedEvent,
  TypedListener,
  OnEvent,
  PromiseOrValue,
} from "../../../common";

export interface IBridgeInterface extends utils.Interface {
  functions: {
    "activeOutbox()": FunctionFragment;
    "allowedInboxes(address)": FunctionFragment;
    "allowedOutboxes(address)": FunctionFragment;
    "deliverMessageToInbox(uint8,address,bytes32)": FunctionFragment;
    "executeCall(address,uint256,bytes)": FunctionFragment;
    "inboxAccs(uint256)": FunctionFragment;
    "messageCount()": FunctionFragment;
    "setInbox(address,bool)": FunctionFragment;
    "setOutbox(address,bool)": FunctionFragment;
  };

  getFunction(
    nameOrSignatureOrTopic:
      | "activeOutbox"
      | "allowedInboxes"
      | "allowedOutboxes"
      | "deliverMessageToInbox"
      | "executeCall"
      | "inboxAccs"
      | "messageCount"
      | "setInbox"
      | "setOutbox",
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "activeOutbox",
    values?: undefined,
  ): string;
  encodeFunctionData(
    functionFragment: "allowedInboxes",
    values: [PromiseOrValue<string>],
  ): string;
  encodeFunctionData(
    functionFragment: "allowedOutboxes",
    values: [PromiseOrValue<string>],
  ): string;
  encodeFunctionData(
    functionFragment: "deliverMessageToInbox",
    values: [
      PromiseOrValue<BigNumberish>,
      PromiseOrValue<string>,
      PromiseOrValue<BytesLike>,
    ],
  ): string;
  encodeFunctionData(
    functionFragment: "executeCall",
    values: [
      PromiseOrValue<string>,
      PromiseOrValue<BigNumberish>,
      PromiseOrValue<BytesLike>,
    ],
  ): string;
  encodeFunctionData(
    functionFragment: "inboxAccs",
    values: [PromiseOrValue<BigNumberish>],
  ): string;
  encodeFunctionData(
    functionFragment: "messageCount",
    values?: undefined,
  ): string;
  encodeFunctionData(
    functionFragment: "setInbox",
    values: [PromiseOrValue<string>, PromiseOrValue<boolean>],
  ): string;
  encodeFunctionData(
    functionFragment: "setOutbox",
    values: [PromiseOrValue<string>, PromiseOrValue<boolean>],
  ): string;

  decodeFunctionResult(
    functionFragment: "activeOutbox",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "allowedInboxes",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "allowedOutboxes",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "deliverMessageToInbox",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "executeCall",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(functionFragment: "inboxAccs", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "messageCount",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(functionFragment: "setInbox", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "setOutbox", data: BytesLike): Result;

  events: {
    "BridgeCallTriggered(address,address,uint256,bytes)": EventFragment;
    "InboxToggle(address,bool)": EventFragment;
    "MessageDelivered(uint256,bytes32,address,uint8,address,bytes32)": EventFragment;
    "OutboxToggle(address,bool)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "BridgeCallTriggered"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "InboxToggle"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "MessageDelivered"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "OutboxToggle"): EventFragment;
}

export interface BridgeCallTriggeredEventObject {
  outbox: string;
  destAddr: string;
  amount: BigNumber;
  data: string;
}
export type BridgeCallTriggeredEvent = TypedEvent<
  [string, string, BigNumber, string],
  BridgeCallTriggeredEventObject
>;

export type BridgeCallTriggeredEventFilter =
  TypedEventFilter<BridgeCallTriggeredEvent>;

export interface InboxToggleEventObject {
  inbox: string;
  enabled: boolean;
}
export type InboxToggleEvent = TypedEvent<
  [string, boolean],
  InboxToggleEventObject
>;

export type InboxToggleEventFilter = TypedEventFilter<InboxToggleEvent>;

export interface MessageDeliveredEventObject {
  messageIndex: BigNumber;
  beforeInboxAcc: string;
  inbox: string;
  kind: number;
  sender: string;
  messageDataHash: string;
}
export type MessageDeliveredEvent = TypedEvent<
  [BigNumber, string, string, number, string, string],
  MessageDeliveredEventObject
>;

export type MessageDeliveredEventFilter =
  TypedEventFilter<MessageDeliveredEvent>;

export interface OutboxToggleEventObject {
  outbox: string;
  enabled: boolean;
}
export type OutboxToggleEvent = TypedEvent<
  [string, boolean],
  OutboxToggleEventObject
>;

export type OutboxToggleEventFilter = TypedEventFilter<OutboxToggleEvent>;

export interface IBridge extends BaseContract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  interface: IBridgeInterface;

  queryFilter<TEvent extends TypedEvent>(
    event: TypedEventFilter<TEvent>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined,
  ): Promise<Array<TEvent>>;

  listeners<TEvent extends TypedEvent>(
    eventFilter?: TypedEventFilter<TEvent>,
  ): Array<TypedListener<TEvent>>;
  listeners(eventName?: string): Array<Listener>;
  removeAllListeners<TEvent extends TypedEvent>(
    eventFilter: TypedEventFilter<TEvent>,
  ): this;
  removeAllListeners(eventName?: string): this;
  off: OnEvent<this>;
  on: OnEvent<this>;
  once: OnEvent<this>;
  removeListener: OnEvent<this>;

  functions: {
    activeOutbox(overrides?: CallOverrides): Promise<[string]>;

    allowedInboxes(
      inbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<[boolean]>;

    allowedOutboxes(
      outbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<[boolean]>;

    deliverMessageToInbox(
      kind: PromiseOrValue<BigNumberish>,
      sender: PromiseOrValue<string>,
      messageDataHash: PromiseOrValue<BytesLike>,
      overrides?: PayableOverrides & { from?: PromiseOrValue<string> },
    ): Promise<ContractTransaction>;

    executeCall(
      destAddr: PromiseOrValue<string>,
      amount: PromiseOrValue<BigNumberish>,
      data: PromiseOrValue<BytesLike>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<ContractTransaction>;

    inboxAccs(
      index: PromiseOrValue<BigNumberish>,
      overrides?: CallOverrides,
    ): Promise<[string]>;

    messageCount(overrides?: CallOverrides): Promise<[BigNumber]>;

    setInbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<ContractTransaction>;

    setOutbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<ContractTransaction>;
  };

  activeOutbox(overrides?: CallOverrides): Promise<string>;

  allowedInboxes(
    inbox: PromiseOrValue<string>,
    overrides?: CallOverrides,
  ): Promise<boolean>;

  allowedOutboxes(
    outbox: PromiseOrValue<string>,
    overrides?: CallOverrides,
  ): Promise<boolean>;

  deliverMessageToInbox(
    kind: PromiseOrValue<BigNumberish>,
    sender: PromiseOrValue<string>,
    messageDataHash: PromiseOrValue<BytesLike>,
    overrides?: PayableOverrides & { from?: PromiseOrValue<string> },
  ): Promise<ContractTransaction>;

  executeCall(
    destAddr: PromiseOrValue<string>,
    amount: PromiseOrValue<BigNumberish>,
    data: PromiseOrValue<BytesLike>,
    overrides?: Overrides & { from?: PromiseOrValue<string> },
  ): Promise<ContractTransaction>;

  inboxAccs(
    index: PromiseOrValue<BigNumberish>,
    overrides?: CallOverrides,
  ): Promise<string>;

  messageCount(overrides?: CallOverrides): Promise<BigNumber>;

  setInbox(
    inbox: PromiseOrValue<string>,
    enabled: PromiseOrValue<boolean>,
    overrides?: Overrides & { from?: PromiseOrValue<string> },
  ): Promise<ContractTransaction>;

  setOutbox(
    inbox: PromiseOrValue<string>,
    enabled: PromiseOrValue<boolean>,
    overrides?: Overrides & { from?: PromiseOrValue<string> },
  ): Promise<ContractTransaction>;

  callStatic: {
    activeOutbox(overrides?: CallOverrides): Promise<string>;

    allowedInboxes(
      inbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<boolean>;

    allowedOutboxes(
      outbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<boolean>;

    deliverMessageToInbox(
      kind: PromiseOrValue<BigNumberish>,
      sender: PromiseOrValue<string>,
      messageDataHash: PromiseOrValue<BytesLike>,
      overrides?: CallOverrides,
    ): Promise<BigNumber>;

    executeCall(
      destAddr: PromiseOrValue<string>,
      amount: PromiseOrValue<BigNumberish>,
      data: PromiseOrValue<BytesLike>,
      overrides?: CallOverrides,
    ): Promise<[boolean, string] & { success: boolean; returnData: string }>;

    inboxAccs(
      index: PromiseOrValue<BigNumberish>,
      overrides?: CallOverrides,
    ): Promise<string>;

    messageCount(overrides?: CallOverrides): Promise<BigNumber>;

    setInbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: CallOverrides,
    ): Promise<void>;

    setOutbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: CallOverrides,
    ): Promise<void>;
  };

  filters: {
    "BridgeCallTriggered(address,address,uint256,bytes)"(
      outbox?: PromiseOrValue<string> | null,
      destAddr?: PromiseOrValue<string> | null,
      amount?: null,
      data?: null,
    ): BridgeCallTriggeredEventFilter;
    BridgeCallTriggered(
      outbox?: PromiseOrValue<string> | null,
      destAddr?: PromiseOrValue<string> | null,
      amount?: null,
      data?: null,
    ): BridgeCallTriggeredEventFilter;

    "InboxToggle(address,bool)"(
      inbox?: PromiseOrValue<string> | null,
      enabled?: null,
    ): InboxToggleEventFilter;
    InboxToggle(
      inbox?: PromiseOrValue<string> | null,
      enabled?: null,
    ): InboxToggleEventFilter;

    "MessageDelivered(uint256,bytes32,address,uint8,address,bytes32)"(
      messageIndex?: PromiseOrValue<BigNumberish> | null,
      beforeInboxAcc?: PromiseOrValue<BytesLike> | null,
      inbox?: null,
      kind?: null,
      sender?: null,
      messageDataHash?: null,
    ): MessageDeliveredEventFilter;
    MessageDelivered(
      messageIndex?: PromiseOrValue<BigNumberish> | null,
      beforeInboxAcc?: PromiseOrValue<BytesLike> | null,
      inbox?: null,
      kind?: null,
      sender?: null,
      messageDataHash?: null,
    ): MessageDeliveredEventFilter;

    "OutboxToggle(address,bool)"(
      outbox?: PromiseOrValue<string> | null,
      enabled?: null,
    ): OutboxToggleEventFilter;
    OutboxToggle(
      outbox?: PromiseOrValue<string> | null,
      enabled?: null,
    ): OutboxToggleEventFilter;
  };

  estimateGas: {
    activeOutbox(overrides?: CallOverrides): Promise<BigNumber>;

    allowedInboxes(
      inbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<BigNumber>;

    allowedOutboxes(
      outbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<BigNumber>;

    deliverMessageToInbox(
      kind: PromiseOrValue<BigNumberish>,
      sender: PromiseOrValue<string>,
      messageDataHash: PromiseOrValue<BytesLike>,
      overrides?: PayableOverrides & { from?: PromiseOrValue<string> },
    ): Promise<BigNumber>;

    executeCall(
      destAddr: PromiseOrValue<string>,
      amount: PromiseOrValue<BigNumberish>,
      data: PromiseOrValue<BytesLike>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<BigNumber>;

    inboxAccs(
      index: PromiseOrValue<BigNumberish>,
      overrides?: CallOverrides,
    ): Promise<BigNumber>;

    messageCount(overrides?: CallOverrides): Promise<BigNumber>;

    setInbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<BigNumber>;

    setOutbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    activeOutbox(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    allowedInboxes(
      inbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<PopulatedTransaction>;

    allowedOutboxes(
      outbox: PromiseOrValue<string>,
      overrides?: CallOverrides,
    ): Promise<PopulatedTransaction>;

    deliverMessageToInbox(
      kind: PromiseOrValue<BigNumberish>,
      sender: PromiseOrValue<string>,
      messageDataHash: PromiseOrValue<BytesLike>,
      overrides?: PayableOverrides & { from?: PromiseOrValue<string> },
    ): Promise<PopulatedTransaction>;

    executeCall(
      destAddr: PromiseOrValue<string>,
      amount: PromiseOrValue<BigNumberish>,
      data: PromiseOrValue<BytesLike>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<PopulatedTransaction>;

    inboxAccs(
      index: PromiseOrValue<BigNumberish>,
      overrides?: CallOverrides,
    ): Promise<PopulatedTransaction>;

    messageCount(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    setInbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<PopulatedTransaction>;

    setOutbox(
      inbox: PromiseOrValue<string>,
      enabled: PromiseOrValue<boolean>,
      overrides?: Overrides & { from?: PromiseOrValue<string> },
    ): Promise<PopulatedTransaction>;
  };
}
