// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/permissions/v1beta1/params.proto" (package "injective.permissions.v1beta1", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
/**
 * EnforcedRestrictionsContract defines an EVM contract with its pause,
 * blacklist and unblacklist event signatures
 *
 * @generated from protobuf message injective.permissions.v1beta1.EnforcedRestrictionsEVMContract
 */
export interface EnforcedRestrictionsEVMContract {
    /**
     * EVM address of the contract
     *
     * @generated from protobuf field: string contract_address = 1
     */
    contractAddress: string;
    /**
     * Pause event signature for the contract (e.g. "Pause()")
     *
     * @generated from protobuf field: string pause_event_signature = 2
     */
    pauseEventSignature: string;
    /**
     * Unpause event signature for the contract (e.g. "Unpause()")
     *
     * @generated from protobuf field: string unpause_event_signature = 3
     */
    unpauseEventSignature: string;
    /**
     * Blacklist event signature for the contract (e.g. Blacklisted(address)")
     *
     * @generated from protobuf field: string blacklist_event_signature = 4
     */
    blacklistEventSignature: string;
    /**
     * UnBlacklist event signature for the contract (e.g.
     * "UnBlacklisted(address)")
     *
     * @generated from protobuf field: string unblacklist_event_signature = 5
     */
    unblacklistEventSignature: string;
}
/**
 * Params defines the parameters for the permissions module.
 *
 * @generated from protobuf message injective.permissions.v1beta1.Params
 */
export interface Params {
    /**
     * Max amount of gas allowed for contract hook queries
     *
     * @generated from protobuf field: uint64 contract_hook_max_gas = 1
     */
    contractHookMaxGas: bigint;
    /**
     * DEPRECATED in favor of enforced_restrictions_evm_contracts, but left
     * for compatibility and upgrade purposes
     *
     * EVM addresses of contracts that will not bypass module-to-module transfers
     *
     * @generated from protobuf field: repeated string deprecated_enforced_restrictions_contracts = 2
     */
    deprecatedEnforcedRestrictionsContracts: string[];
    /**
     * EVM Contracts that module will be listening to sync permissions stored
     * inside namespace on every update inside smart contract state
     *
     * @generated from protobuf field: repeated injective.permissions.v1beta1.EnforcedRestrictionsEVMContract enforced_restrictions_evm_contracts = 3
     */
    enforcedRestrictionsEvmContracts: EnforcedRestrictionsEVMContract[];
}
// @generated message type with reflection information, may provide speed optimized methods
class EnforcedRestrictionsEVMContract$Type extends MessageType<EnforcedRestrictionsEVMContract> {
    constructor() {
        super("injective.permissions.v1beta1.EnforcedRestrictionsEVMContract", [
            { no: 1, name: "contract_address", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "cosmos_proto.scalar": "cosmos.AddressString" } },
            { no: 2, name: "pause_event_signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "unpause_event_signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "blacklist_event_signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "unblacklist_event_signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ], { "gogoproto.equal": true });
    }
    create(value?: PartialMessage<EnforcedRestrictionsEVMContract>): EnforcedRestrictionsEVMContract {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.contractAddress = "";
        message.pauseEventSignature = "";
        message.unpauseEventSignature = "";
        message.blacklistEventSignature = "";
        message.unblacklistEventSignature = "";
        if (value !== undefined)
            reflectionMergePartial<EnforcedRestrictionsEVMContract>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnforcedRestrictionsEVMContract): EnforcedRestrictionsEVMContract {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string contract_address */ 1:
                    message.contractAddress = reader.string();
                    break;
                case /* string pause_event_signature */ 2:
                    message.pauseEventSignature = reader.string();
                    break;
                case /* string unpause_event_signature */ 3:
                    message.unpauseEventSignature = reader.string();
                    break;
                case /* string blacklist_event_signature */ 4:
                    message.blacklistEventSignature = reader.string();
                    break;
                case /* string unblacklist_event_signature */ 5:
                    message.unblacklistEventSignature = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: EnforcedRestrictionsEVMContract, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string contract_address = 1; */
        if (message.contractAddress !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.contractAddress);
        /* string pause_event_signature = 2; */
        if (message.pauseEventSignature !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.pauseEventSignature);
        /* string unpause_event_signature = 3; */
        if (message.unpauseEventSignature !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.unpauseEventSignature);
        /* string blacklist_event_signature = 4; */
        if (message.blacklistEventSignature !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.blacklistEventSignature);
        /* string unblacklist_event_signature = 5; */
        if (message.unblacklistEventSignature !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.unblacklistEventSignature);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.EnforcedRestrictionsEVMContract
 */
export const EnforcedRestrictionsEVMContract = new EnforcedRestrictionsEVMContract$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Params$Type extends MessageType<Params> {
    constructor() {
        super("injective.permissions.v1beta1.Params", [
            { no: 1, name: "contract_hook_max_gas", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 2, name: "deprecated_enforced_restrictions_contracts", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "enforced_restrictions_evm_contracts", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EnforcedRestrictionsEVMContract, options: { "gogoproto.nullable": false } }
        ], { "gogoproto.equal": true, "amino.name": "permissions/Params" });
    }
    create(value?: PartialMessage<Params>): Params {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.contractHookMaxGas = 0n;
        message.deprecatedEnforcedRestrictionsContracts = [];
        message.enforcedRestrictionsEvmContracts = [];
        if (value !== undefined)
            reflectionMergePartial<Params>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Params): Params {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* uint64 contract_hook_max_gas */ 1:
                    message.contractHookMaxGas = reader.uint64().toBigInt();
                    break;
                case /* repeated string deprecated_enforced_restrictions_contracts */ 2:
                    message.deprecatedEnforcedRestrictionsContracts.push(reader.string());
                    break;
                case /* repeated injective.permissions.v1beta1.EnforcedRestrictionsEVMContract enforced_restrictions_evm_contracts */ 3:
                    message.enforcedRestrictionsEvmContracts.push(EnforcedRestrictionsEVMContract.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* uint64 contract_hook_max_gas = 1; */
        if (message.contractHookMaxGas !== 0n)
            writer.tag(1, WireType.Varint).uint64(message.contractHookMaxGas);
        /* repeated string deprecated_enforced_restrictions_contracts = 2; */
        for (let i = 0; i < message.deprecatedEnforcedRestrictionsContracts.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.deprecatedEnforcedRestrictionsContracts[i]);
        /* repeated injective.permissions.v1beta1.EnforcedRestrictionsEVMContract enforced_restrictions_evm_contracts = 3; */
        for (let i = 0; i < message.enforcedRestrictionsEvmContracts.length; i++)
            EnforcedRestrictionsEVMContract.internalBinaryWrite(message.enforcedRestrictionsEvmContracts[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.Params
 */
export const Params = new Params$Type();
