import { utils, BytesLike, BigNumberish, BigNumber, BaseContract, Signer, Overrides, ContractTransaction, CallOverrides, PopulatedTransaction } from 'ethers';
import { FunctionFragment, Result, EventFragment } from '@ethersproject/abi';
import { Provider, Listener } from '@ethersproject/providers';
import { TypedEvent, TypedEventFilter, TypedListener, OnEvent } from './common.js';

interface IByocRegistryInterface extends utils.Interface {
    contractName: string | "IByocRegistry";
    functions: {
        "addToPublicList(address,string)": FunctionFragment;
        "approveOperator(address,bool)": FunctionFragment;
        "getAllPublicPublishedContracts()": FunctionFragment;
        "getAllPublishedContracts(address)": FunctionFragment;
        "getPublicId(address,string)": FunctionFragment;
        "getPublishedContract(address,string)": FunctionFragment;
        "getPublishedContractVersions(address,string)": FunctionFragment;
        "isApprovedByPublisher(address,address)": FunctionFragment;
        "publishContract(address,string,bytes32,address,string)": FunctionFragment;
        "removeFromPublicList(address,string)": FunctionFragment;
        "unpublishContract(address,string)": FunctionFragment;
    };
    encodeFunctionData(functionFragment: "addToPublicList", values: [string, string]): string;
    encodeFunctionData(functionFragment: "approveOperator", values: [string, boolean]): string;
    encodeFunctionData(functionFragment: "getAllPublicPublishedContracts", values?: undefined): string;
    encodeFunctionData(functionFragment: "getAllPublishedContracts", values: [string]): string;
    encodeFunctionData(functionFragment: "getPublicId", values: [string, string]): string;
    encodeFunctionData(functionFragment: "getPublishedContract", values: [string, string]): string;
    encodeFunctionData(functionFragment: "getPublishedContractVersions", values: [string, string]): string;
    encodeFunctionData(functionFragment: "isApprovedByPublisher", values: [string, string]): string;
    encodeFunctionData(functionFragment: "publishContract", values: [string, string, BytesLike, string, string]): string;
    encodeFunctionData(functionFragment: "removeFromPublicList", values: [string, string]): string;
    encodeFunctionData(functionFragment: "unpublishContract", values: [string, string]): string;
    decodeFunctionResult(functionFragment: "addToPublicList", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "approveOperator", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "getAllPublicPublishedContracts", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "getAllPublishedContracts", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "getPublicId", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "getPublishedContract", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "getPublishedContractVersions", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "isApprovedByPublisher", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "publishContract", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "removeFromPublicList", data: BytesLike): Result;
    decodeFunctionResult(functionFragment: "unpublishContract", data: BytesLike): Result;
    events: {
        "AddedContractToPublicList(address,string)": EventFragment;
        "Approved(address,address,bool)": EventFragment;
        "ContractPublished(address,address,tuple)": EventFragment;
        "ContractUnpublished(address,address,string)": EventFragment;
        "Paused(bool)": EventFragment;
        "RemovedContractToPublicList(address,string)": EventFragment;
    };
    getEvent(nameOrSignatureOrTopic: "AddedContractToPublicList"): EventFragment;
    getEvent(nameOrSignatureOrTopic: "Approved"): EventFragment;
    getEvent(nameOrSignatureOrTopic: "ContractPublished"): EventFragment;
    getEvent(nameOrSignatureOrTopic: "ContractUnpublished"): EventFragment;
    getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment;
    getEvent(nameOrSignatureOrTopic: "RemovedContractToPublicList"): EventFragment;
}
declare type AddedContractToPublicListEvent = TypedEvent<[
    string,
    string
], {
    publisher: string;
    contractId: string;
}>;
declare type AddedContractToPublicListEventFilter = TypedEventFilter<AddedContractToPublicListEvent>;
declare type ApprovedEvent = TypedEvent<[
    string,
    string,
    boolean
], {
    publisher: string;
    operator: string;
    isApproved: boolean;
}>;
declare type ApprovedEventFilter = TypedEventFilter<ApprovedEvent>;
declare type ContractPublishedEvent = TypedEvent<[
    string,
    string,
    IByocRegistry.CustomContractInstanceStructOutput
], {
    operator: string;
    publisher: string;
    publishedContract: IByocRegistry.CustomContractInstanceStructOutput;
}>;
declare type ContractPublishedEventFilter = TypedEventFilter<ContractPublishedEvent>;
declare type ContractUnpublishedEvent = TypedEvent<[
    string,
    string,
    string
], {
    operator: string;
    publisher: string;
    contractId: string;
}>;
declare type ContractUnpublishedEventFilter = TypedEventFilter<ContractUnpublishedEvent>;
declare type PausedEvent = TypedEvent<[boolean], {
    isPaused: boolean;
}>;
declare type PausedEventFilter = TypedEventFilter<PausedEvent>;
declare type RemovedContractToPublicListEvent = TypedEvent<[
    string,
    string
], {
    publisher: string;
    contractId: string;
}>;
declare type RemovedContractToPublicListEventFilter = TypedEventFilter<RemovedContractToPublicListEvent>;
declare namespace IByocRegistry {
    type CustomContractInstanceStruct = {
        contractId: string;
        publishTimestamp: BigNumberish;
        publishMetadataUri: string;
        bytecodeHash: BytesLike;
        implementation: string;
    };
    type CustomContractInstanceStructOutput = [
        string,
        BigNumber,
        string,
        string,
        string
    ] & {
        contractId: string;
        publishTimestamp: BigNumber;
        publishMetadataUri: string;
        bytecodeHash: string;
        implementation: string;
    };
}
interface IByocRegistry extends BaseContract {
    contractName: string | "IByocRegistry";
    connect(signerOrProvider: Signer | Provider | string): this;
    attach(addressOrName: string): this;
    deployed(): Promise<this>;
    interface: IByocRegistryInterface;
    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: {
        addToPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
        approveOperator(operator: string, toApprove: boolean, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
        getAllPublicPublishedContracts(overrides?: CallOverrides): Promise<[
            IByocRegistry.CustomContractInstanceStructOutput[]
        ] & {
            published: IByocRegistry.CustomContractInstanceStructOutput[];
        }>;
        getAllPublishedContracts(publisher: string, overrides?: CallOverrides): Promise<[
            IByocRegistry.CustomContractInstanceStructOutput[]
        ] & {
            published: IByocRegistry.CustomContractInstanceStructOutput[];
        }>;
        getPublicId(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
        getPublishedContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<[
            IByocRegistry.CustomContractInstanceStructOutput
        ] & {
            published: IByocRegistry.CustomContractInstanceStructOutput;
        }>;
        getPublishedContractVersions(publisher: string, contractId: string, overrides?: CallOverrides): Promise<[
            IByocRegistry.CustomContractInstanceStructOutput[]
        ] & {
            published: IByocRegistry.CustomContractInstanceStructOutput[];
        }>;
        isApprovedByPublisher(publisher: string, operator: string, overrides?: CallOverrides): Promise<[boolean] & {
            isApproved: boolean;
        }>;
        publishContract(publisher: string, publishMetadataUri: string, bytecodeHash: BytesLike, implementation: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
        removeFromPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
        unpublishContract(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<ContractTransaction>;
    };
    addToPublicList(publisher: string, contractId: string, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    approveOperator(operator: string, toApprove: boolean, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    getAllPublicPublishedContracts(overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
    getAllPublishedContracts(publisher: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
    getPublicId(publisher: string, contractId: string, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    getPublishedContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput>;
    getPublishedContractVersions(publisher: string, contractId: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
    isApprovedByPublisher(publisher: string, operator: string, overrides?: CallOverrides): Promise<boolean>;
    publishContract(publisher: string, publishMetadataUri: string, bytecodeHash: BytesLike, implementation: string, contractId: string, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    removeFromPublicList(publisher: string, contractId: string, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    unpublishContract(publisher: string, contractId: string, overrides?: Overrides & {
        from?: string | Promise<string>;
    }): Promise<ContractTransaction>;
    callStatic: {
        addToPublicList(publisher: string, contractId: string, overrides?: CallOverrides): Promise<void>;
        approveOperator(operator: string, toApprove: boolean, overrides?: CallOverrides): Promise<void>;
        getAllPublicPublishedContracts(overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
        getAllPublishedContracts(publisher: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
        getPublicId(publisher: string, contractId: string, overrides?: CallOverrides): Promise<BigNumber>;
        getPublishedContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput>;
        getPublishedContractVersions(publisher: string, contractId: string, overrides?: CallOverrides): Promise<IByocRegistry.CustomContractInstanceStructOutput[]>;
        isApprovedByPublisher(publisher: string, operator: string, overrides?: CallOverrides): Promise<boolean>;
        publishContract(publisher: string, publishMetadataUri: string, bytecodeHash: BytesLike, implementation: string, contractId: string, overrides?: CallOverrides): Promise<void>;
        removeFromPublicList(publisher: string, contractId: string, overrides?: CallOverrides): Promise<void>;
        unpublishContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<void>;
    };
    filters: {
        "AddedContractToPublicList(address,string)"(publisher?: string | null, contractId?: string | null): AddedContractToPublicListEventFilter;
        AddedContractToPublicList(publisher?: string | null, contractId?: string | null): AddedContractToPublicListEventFilter;
        "Approved(address,address,bool)"(publisher?: string | null, operator?: string | null, isApproved?: null): ApprovedEventFilter;
        Approved(publisher?: string | null, operator?: string | null, isApproved?: null): ApprovedEventFilter;
        "ContractPublished(address,address,tuple)"(operator?: string | null, publisher?: string | null, publishedContract?: null): ContractPublishedEventFilter;
        ContractPublished(operator?: string | null, publisher?: string | null, publishedContract?: null): ContractPublishedEventFilter;
        "ContractUnpublished(address,address,string)"(operator?: string | null, publisher?: string | null, contractId?: string | null): ContractUnpublishedEventFilter;
        ContractUnpublished(operator?: string | null, publisher?: string | null, contractId?: string | null): ContractUnpublishedEventFilter;
        "Paused(bool)"(isPaused?: null): PausedEventFilter;
        Paused(isPaused?: null): PausedEventFilter;
        "RemovedContractToPublicList(address,string)"(publisher?: string | null, contractId?: string | null): RemovedContractToPublicListEventFilter;
        RemovedContractToPublicList(publisher?: string | null, contractId?: string | null): RemovedContractToPublicListEventFilter;
    };
    estimateGas: {
        addToPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
        approveOperator(operator: string, toApprove: boolean, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
        getAllPublicPublishedContracts(overrides?: CallOverrides): Promise<BigNumber>;
        getAllPublishedContracts(publisher: string, overrides?: CallOverrides): Promise<BigNumber>;
        getPublicId(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
        getPublishedContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<BigNumber>;
        getPublishedContractVersions(publisher: string, contractId: string, overrides?: CallOverrides): Promise<BigNumber>;
        isApprovedByPublisher(publisher: string, operator: string, overrides?: CallOverrides): Promise<BigNumber>;
        publishContract(publisher: string, publishMetadataUri: string, bytecodeHash: BytesLike, implementation: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
        removeFromPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
        unpublishContract(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<BigNumber>;
    };
    populateTransaction: {
        addToPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
        approveOperator(operator: string, toApprove: boolean, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
        getAllPublicPublishedContracts(overrides?: CallOverrides): Promise<PopulatedTransaction>;
        getAllPublishedContracts(publisher: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
        getPublicId(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
        getPublishedContract(publisher: string, contractId: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
        getPublishedContractVersions(publisher: string, contractId: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
        isApprovedByPublisher(publisher: string, operator: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
        publishContract(publisher: string, publishMetadataUri: string, bytecodeHash: BytesLike, implementation: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
        removeFromPublicList(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
        unpublishContract(publisher: string, contractId: string, overrides?: Overrides & {
            from?: string | Promise<string>;
        }): Promise<PopulatedTransaction>;
    };
}

export { AddedContractToPublicListEvent, AddedContractToPublicListEventFilter, ApprovedEvent, ApprovedEventFilter, ContractPublishedEvent, ContractPublishedEventFilter, ContractUnpublishedEvent, ContractUnpublishedEventFilter, IByocRegistry, IByocRegistryInterface, PausedEvent, PausedEventFilter, RemovedContractToPublicListEvent, RemovedContractToPublicListEventFilter };
