/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
  BigNumberish,
  BytesLike,
  FunctionFragment,
  Result,
  Interface,
  EventFragment,
  AddressLike,
  ContractRunner,
  ContractMethod,
  Listener,
} from "ethers";
import type {
  TypedContractEvent,
  TypedDeferredTopicFilter,
  TypedEventLog,
  TypedLogDescription,
  TypedListener,
  TypedContractMethod,
} from "../../../common";

export interface IBridgeInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "activeOutbox"
      | "allowedInboxes"
      | "allowedOutboxes"
      | "deliverMessageToInbox"
      | "executeCall"
      | "inboxAccs"
      | "messageCount"
      | "setInbox"
      | "setOutbox",
  ): FunctionFragment;

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

  encodeFunctionData(
    functionFragment: "activeOutbox",
    values?: undefined,
  ): string;
  encodeFunctionData(
    functionFragment: "allowedInboxes",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "allowedOutboxes",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "deliverMessageToInbox",
    values: [BigNumberish, AddressLike, BytesLike],
  ): string;
  encodeFunctionData(
    functionFragment: "executeCall",
    values: [AddressLike, BigNumberish, BytesLike],
  ): string;
  encodeFunctionData(
    functionFragment: "inboxAccs",
    values: [BigNumberish],
  ): string;
  encodeFunctionData(
    functionFragment: "messageCount",
    values?: undefined,
  ): string;
  encodeFunctionData(
    functionFragment: "setInbox",
    values: [AddressLike, boolean],
  ): string;
  encodeFunctionData(
    functionFragment: "setOutbox",
    values: [AddressLike, 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;
}

export namespace BridgeCallTriggeredEvent {
  export type InputTuple = [
    outbox: AddressLike,
    destAddr: AddressLike,
    amount: BigNumberish,
    data: BytesLike,
  ];
  export type OutputTuple = [
    outbox: string,
    destAddr: string,
    amount: bigint,
    data: string,
  ];
  export interface OutputObject {
    outbox: string;
    destAddr: string;
    amount: bigint;
    data: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace InboxToggleEvent {
  export type InputTuple = [inbox: AddressLike, enabled: boolean];
  export type OutputTuple = [inbox: string, enabled: boolean];
  export interface OutputObject {
    inbox: string;
    enabled: boolean;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace MessageDeliveredEvent {
  export type InputTuple = [
    messageIndex: BigNumberish,
    beforeInboxAcc: BytesLike,
    inbox: AddressLike,
    kind: BigNumberish,
    sender: AddressLike,
    messageDataHash: BytesLike,
  ];
  export type OutputTuple = [
    messageIndex: bigint,
    beforeInboxAcc: string,
    inbox: string,
    kind: bigint,
    sender: string,
    messageDataHash: string,
  ];
  export interface OutputObject {
    messageIndex: bigint;
    beforeInboxAcc: string;
    inbox: string;
    kind: bigint;
    sender: string;
    messageDataHash: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace OutboxToggleEvent {
  export type InputTuple = [outbox: AddressLike, enabled: boolean];
  export type OutputTuple = [outbox: string, enabled: boolean];
  export interface OutputObject {
    outbox: string;
    enabled: boolean;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export interface IBridge extends BaseContract {
  connect(runner?: ContractRunner | null): IBridge;
  waitForDeployment(): Promise<this>;

  interface: IBridgeInterface;

  queryFilter<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined,
  ): Promise<Array<TypedEventLog<TCEvent>>>;
  queryFilter<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined,
  ): Promise<Array<TypedEventLog<TCEvent>>>;

  on<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>,
  ): Promise<this>;
  on<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>,
  ): Promise<this>;

  once<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>,
  ): Promise<this>;
  once<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>,
  ): Promise<this>;

  listeners<TCEvent extends TypedContractEvent>(
    event: TCEvent,
  ): Promise<Array<TypedListener<TCEvent>>>;
  listeners(eventName?: string): Promise<Array<Listener>>;
  removeAllListeners<TCEvent extends TypedContractEvent>(
    event?: TCEvent,
  ): Promise<this>;

  activeOutbox: TypedContractMethod<[], [string], "view">;

  allowedInboxes: TypedContractMethod<[inbox: AddressLike], [boolean], "view">;

  allowedOutboxes: TypedContractMethod<
    [outbox: AddressLike],
    [boolean],
    "view"
  >;

  deliverMessageToInbox: TypedContractMethod<
    [kind: BigNumberish, sender: AddressLike, messageDataHash: BytesLike],
    [bigint],
    "payable"
  >;

  executeCall: TypedContractMethod<
    [destAddr: AddressLike, amount: BigNumberish, data: BytesLike],
    [[boolean, string] & { success: boolean; returnData: string }],
    "nonpayable"
  >;

  inboxAccs: TypedContractMethod<[index: BigNumberish], [string], "view">;

  messageCount: TypedContractMethod<[], [bigint], "view">;

  setInbox: TypedContractMethod<
    [inbox: AddressLike, enabled: boolean],
    [void],
    "nonpayable"
  >;

  setOutbox: TypedContractMethod<
    [inbox: AddressLike, enabled: boolean],
    [void],
    "nonpayable"
  >;

  getFunction<T extends ContractMethod = ContractMethod>(
    key: string | FunctionFragment,
  ): T;

  getFunction(
    nameOrSignature: "activeOutbox",
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "allowedInboxes",
  ): TypedContractMethod<[inbox: AddressLike], [boolean], "view">;
  getFunction(
    nameOrSignature: "allowedOutboxes",
  ): TypedContractMethod<[outbox: AddressLike], [boolean], "view">;
  getFunction(
    nameOrSignature: "deliverMessageToInbox",
  ): TypedContractMethod<
    [kind: BigNumberish, sender: AddressLike, messageDataHash: BytesLike],
    [bigint],
    "payable"
  >;
  getFunction(
    nameOrSignature: "executeCall",
  ): TypedContractMethod<
    [destAddr: AddressLike, amount: BigNumberish, data: BytesLike],
    [[boolean, string] & { success: boolean; returnData: string }],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "inboxAccs",
  ): TypedContractMethod<[index: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "messageCount",
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "setInbox",
  ): TypedContractMethod<
    [inbox: AddressLike, enabled: boolean],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "setOutbox",
  ): TypedContractMethod<
    [inbox: AddressLike, enabled: boolean],
    [void],
    "nonpayable"
  >;

  getEvent(
    key: "BridgeCallTriggered",
  ): TypedContractEvent<
    BridgeCallTriggeredEvent.InputTuple,
    BridgeCallTriggeredEvent.OutputTuple,
    BridgeCallTriggeredEvent.OutputObject
  >;
  getEvent(
    key: "InboxToggle",
  ): TypedContractEvent<
    InboxToggleEvent.InputTuple,
    InboxToggleEvent.OutputTuple,
    InboxToggleEvent.OutputObject
  >;
  getEvent(
    key: "MessageDelivered",
  ): TypedContractEvent<
    MessageDeliveredEvent.InputTuple,
    MessageDeliveredEvent.OutputTuple,
    MessageDeliveredEvent.OutputObject
  >;
  getEvent(
    key: "OutboxToggle",
  ): TypedContractEvent<
    OutboxToggleEvent.InputTuple,
    OutboxToggleEvent.OutputTuple,
    OutboxToggleEvent.OutputObject
  >;

  filters: {
    "BridgeCallTriggered(address,address,uint256,bytes)": TypedContractEvent<
      BridgeCallTriggeredEvent.InputTuple,
      BridgeCallTriggeredEvent.OutputTuple,
      BridgeCallTriggeredEvent.OutputObject
    >;
    BridgeCallTriggered: TypedContractEvent<
      BridgeCallTriggeredEvent.InputTuple,
      BridgeCallTriggeredEvent.OutputTuple,
      BridgeCallTriggeredEvent.OutputObject
    >;

    "InboxToggle(address,bool)": TypedContractEvent<
      InboxToggleEvent.InputTuple,
      InboxToggleEvent.OutputTuple,
      InboxToggleEvent.OutputObject
    >;
    InboxToggle: TypedContractEvent<
      InboxToggleEvent.InputTuple,
      InboxToggleEvent.OutputTuple,
      InboxToggleEvent.OutputObject
    >;

    "MessageDelivered(uint256,bytes32,address,uint8,address,bytes32)": TypedContractEvent<
      MessageDeliveredEvent.InputTuple,
      MessageDeliveredEvent.OutputTuple,
      MessageDeliveredEvent.OutputObject
    >;
    MessageDelivered: TypedContractEvent<
      MessageDeliveredEvent.InputTuple,
      MessageDeliveredEvent.OutputTuple,
      MessageDeliveredEvent.OutputObject
    >;

    "OutboxToggle(address,bool)": TypedContractEvent<
      OutboxToggleEvent.InputTuple,
      OutboxToggleEvent.OutputTuple,
      OutboxToggleEvent.OutputObject
    >;
    OutboxToggle: TypedContractEvent<
      OutboxToggleEvent.InputTuple,
      OutboxToggleEvent.OutputTuple,
      OutboxToggleEvent.OutputObject
    >;
  };
}
