//@ts-nocheck
import { Coin } from '../../../cosmos/base/v1beta1/coin.js';
import { Route, Swap } from './swap.js';
import { Algorithm, algorithmFromJSON, algorithmToJSON } from './algorithm.js';
import { BinaryReader, BinaryWriter } from '../../../binary.js';
import { isSet } from '../../../helpers.js';
import {} from '../../../json-safe.js';
function createBaseMsgWithdrawProtocolFees() {
    return {
        signer: '',
        to: '',
    };
}
export const MsgWithdrawProtocolFees = {
    typeUrl: '/noble.swap.v1.MsgWithdrawProtocolFees',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        if (message.to !== '') {
            writer.uint32(18).string(message.to);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgWithdrawProtocolFees();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.to = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            to: isSet(object.to) ? String(object.to) : '',
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.to !== undefined && (obj.to = message.to);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgWithdrawProtocolFees();
        message.signer = object.signer ?? '';
        message.to = object.to ?? '';
        return message;
    },
    fromProtoMsg(message) {
        return MsgWithdrawProtocolFees.decode(message.value);
    },
    toProto(message) {
        return MsgWithdrawProtocolFees.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgWithdrawProtocolFees',
            value: MsgWithdrawProtocolFees.encode(message).finish(),
        };
    },
};
function createBaseMsgWithdrawProtocolFeesResponse() {
    return {};
}
export const MsgWithdrawProtocolFeesResponse = {
    typeUrl: '/noble.swap.v1.MsgWithdrawProtocolFeesResponse',
    encode(_, writer = BinaryWriter.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgWithdrawProtocolFeesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseMsgWithdrawProtocolFeesResponse();
        return message;
    },
    fromProtoMsg(message) {
        return MsgWithdrawProtocolFeesResponse.decode(message.value);
    },
    toProto(message) {
        return MsgWithdrawProtocolFeesResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgWithdrawProtocolFeesResponse',
            value: MsgWithdrawProtocolFeesResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgWithdrawRewards() {
    return {
        signer: '',
    };
}
export const MsgWithdrawRewards = {
    typeUrl: '/noble.swap.v1.MsgWithdrawRewards',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgWithdrawRewards();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgWithdrawRewards();
        message.signer = object.signer ?? '';
        return message;
    },
    fromProtoMsg(message) {
        return MsgWithdrawRewards.decode(message.value);
    },
    toProto(message) {
        return MsgWithdrawRewards.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgWithdrawRewards',
            value: MsgWithdrawRewards.encode(message).finish(),
        };
    },
};
function createBaseMsgWithdrawRewardsResponse() {
    return {
        rewards: [],
    };
}
export const MsgWithdrawRewardsResponse = {
    typeUrl: '/noble.swap.v1.MsgWithdrawRewardsResponse',
    encode(message, writer = BinaryWriter.create()) {
        for (const v of message.rewards) {
            Coin.encode(v, writer.uint32(10).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgWithdrawRewardsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.rewards.push(Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            rewards: Array.isArray(object?.rewards)
                ? object.rewards.map((e) => Coin.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.rewards) {
            obj.rewards = message.rewards.map(e => (e ? Coin.toJSON(e) : undefined));
        }
        else {
            obj.rewards = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgWithdrawRewardsResponse();
        message.rewards = object.rewards?.map(e => Coin.fromPartial(e)) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgWithdrawRewardsResponse.decode(message.value);
    },
    toProto(message) {
        return MsgWithdrawRewardsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgWithdrawRewardsResponse',
            value: MsgWithdrawRewardsResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgSwap() {
    return {
        signer: '',
        amount: Coin.fromPartial({}),
        routes: [],
        min: Coin.fromPartial({}),
    };
}
export const MsgSwap = {
    typeUrl: '/noble.swap.v1.MsgSwap',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        if (message.amount !== undefined) {
            Coin.encode(message.amount, writer.uint32(18).fork()).ldelim();
        }
        for (const v of message.routes) {
            Route.encode(v, writer.uint32(26).fork()).ldelim();
        }
        if (message.min !== undefined) {
            Coin.encode(message.min, writer.uint32(34).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgSwap();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.amount = Coin.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.routes.push(Route.decode(reader, reader.uint32()));
                    break;
                case 4:
                    message.min = Coin.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined,
            routes: Array.isArray(object?.routes)
                ? object.routes.map((e) => Route.fromJSON(e))
                : [],
            min: isSet(object.min) ? Coin.fromJSON(object.min) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.amount !== undefined &&
            (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
        if (message.routes) {
            obj.routes = message.routes.map(e => (e ? Route.toJSON(e) : undefined));
        }
        else {
            obj.routes = [];
        }
        message.min !== undefined &&
            (obj.min = message.min ? Coin.toJSON(message.min) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgSwap();
        message.signer = object.signer ?? '';
        message.amount =
            object.amount !== undefined && object.amount !== null
                ? Coin.fromPartial(object.amount)
                : undefined;
        message.routes = object.routes?.map(e => Route.fromPartial(e)) || [];
        message.min =
            object.min !== undefined && object.min !== null
                ? Coin.fromPartial(object.min)
                : undefined;
        return message;
    },
    fromProtoMsg(message) {
        return MsgSwap.decode(message.value);
    },
    toProto(message) {
        return MsgSwap.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgSwap',
            value: MsgSwap.encode(message).finish(),
        };
    },
};
function createBaseMsgSwapResponse() {
    return {
        result: Coin.fromPartial({}),
        swaps: [],
    };
}
export const MsgSwapResponse = {
    typeUrl: '/noble.swap.v1.MsgSwapResponse',
    encode(message, writer = BinaryWriter.create()) {
        if (message.result !== undefined) {
            Coin.encode(message.result, writer.uint32(10).fork()).ldelim();
        }
        for (const v of message.swaps) {
            Swap.encode(v, writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgSwapResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.result = Coin.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.swaps.push(Swap.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            result: isSet(object.result) ? Coin.fromJSON(object.result) : undefined,
            swaps: Array.isArray(object?.swaps)
                ? object.swaps.map((e) => Swap.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        message.result !== undefined &&
            (obj.result = message.result ? Coin.toJSON(message.result) : undefined);
        if (message.swaps) {
            obj.swaps = message.swaps.map(e => (e ? Swap.toJSON(e) : undefined));
        }
        else {
            obj.swaps = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgSwapResponse();
        message.result =
            object.result !== undefined && object.result !== null
                ? Coin.fromPartial(object.result)
                : undefined;
        message.swaps = object.swaps?.map(e => Swap.fromPartial(e)) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgSwapResponse.decode(message.value);
    },
    toProto(message) {
        return MsgSwapResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgSwapResponse',
            value: MsgSwapResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgPauseByAlgorithm() {
    return {
        signer: '',
        algorithm: 0,
    };
}
export const MsgPauseByAlgorithm = {
    typeUrl: '/noble.swap.v1.MsgPauseByAlgorithm',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        if (message.algorithm !== 0) {
            writer.uint32(16).int32(message.algorithm);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgPauseByAlgorithm();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.algorithm = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            algorithm: isSet(object.algorithm)
                ? algorithmFromJSON(object.algorithm)
                : -1,
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.algorithm !== undefined &&
            (obj.algorithm = algorithmToJSON(message.algorithm));
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgPauseByAlgorithm();
        message.signer = object.signer ?? '';
        message.algorithm = object.algorithm ?? 0;
        return message;
    },
    fromProtoMsg(message) {
        return MsgPauseByAlgorithm.decode(message.value);
    },
    toProto(message) {
        return MsgPauseByAlgorithm.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgPauseByAlgorithm',
            value: MsgPauseByAlgorithm.encode(message).finish(),
        };
    },
};
function createBaseMsgPauseByAlgorithmResponse() {
    return {
        pausedPools: [],
    };
}
export const MsgPauseByAlgorithmResponse = {
    typeUrl: '/noble.swap.v1.MsgPauseByAlgorithmResponse',
    encode(message, writer = BinaryWriter.create()) {
        writer.uint32(10).fork();
        for (const v of message.pausedPools) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgPauseByAlgorithmResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.pausedPools.push(reader.uint64());
                        }
                    }
                    else {
                        message.pausedPools.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            pausedPools: Array.isArray(object?.pausedPools)
                ? object.pausedPools.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pausedPools) {
            obj.pausedPools = message.pausedPools.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.pausedPools = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgPauseByAlgorithmResponse();
        message.pausedPools =
            object.pausedPools?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgPauseByAlgorithmResponse.decode(message.value);
    },
    toProto(message) {
        return MsgPauseByAlgorithmResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgPauseByAlgorithmResponse',
            value: MsgPauseByAlgorithmResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgPauseByPoolIds() {
    return {
        signer: '',
        poolIds: [],
    };
}
export const MsgPauseByPoolIds = {
    typeUrl: '/noble.swap.v1.MsgPauseByPoolIds',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        writer.uint32(18).fork();
        for (const v of message.poolIds) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgPauseByPoolIds();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.poolIds.push(reader.uint64());
                        }
                    }
                    else {
                        message.poolIds.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            poolIds: Array.isArray(object?.poolIds)
                ? object.poolIds.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        if (message.poolIds) {
            obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.poolIds = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgPauseByPoolIds();
        message.signer = object.signer ?? '';
        message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgPauseByPoolIds.decode(message.value);
    },
    toProto(message) {
        return MsgPauseByPoolIds.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgPauseByPoolIds',
            value: MsgPauseByPoolIds.encode(message).finish(),
        };
    },
};
function createBaseMsgPauseByPoolIdsResponse() {
    return {
        pausedPools: [],
    };
}
export const MsgPauseByPoolIdsResponse = {
    typeUrl: '/noble.swap.v1.MsgPauseByPoolIdsResponse',
    encode(message, writer = BinaryWriter.create()) {
        writer.uint32(10).fork();
        for (const v of message.pausedPools) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgPauseByPoolIdsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.pausedPools.push(reader.uint64());
                        }
                    }
                    else {
                        message.pausedPools.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            pausedPools: Array.isArray(object?.pausedPools)
                ? object.pausedPools.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pausedPools) {
            obj.pausedPools = message.pausedPools.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.pausedPools = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgPauseByPoolIdsResponse();
        message.pausedPools =
            object.pausedPools?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgPauseByPoolIdsResponse.decode(message.value);
    },
    toProto(message) {
        return MsgPauseByPoolIdsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgPauseByPoolIdsResponse',
            value: MsgPauseByPoolIdsResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgUnpauseByAlgorithm() {
    return {
        signer: '',
        algorithm: 0,
    };
}
export const MsgUnpauseByAlgorithm = {
    typeUrl: '/noble.swap.v1.MsgUnpauseByAlgorithm',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        if (message.algorithm !== 0) {
            writer.uint32(16).int32(message.algorithm);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgUnpauseByAlgorithm();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.algorithm = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            algorithm: isSet(object.algorithm)
                ? algorithmFromJSON(object.algorithm)
                : -1,
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.algorithm !== undefined &&
            (obj.algorithm = algorithmToJSON(message.algorithm));
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgUnpauseByAlgorithm();
        message.signer = object.signer ?? '';
        message.algorithm = object.algorithm ?? 0;
        return message;
    },
    fromProtoMsg(message) {
        return MsgUnpauseByAlgorithm.decode(message.value);
    },
    toProto(message) {
        return MsgUnpauseByAlgorithm.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgUnpauseByAlgorithm',
            value: MsgUnpauseByAlgorithm.encode(message).finish(),
        };
    },
};
function createBaseMsgUnpauseByAlgorithmResponse() {
    return {
        unpausedPools: [],
    };
}
export const MsgUnpauseByAlgorithmResponse = {
    typeUrl: '/noble.swap.v1.MsgUnpauseByAlgorithmResponse',
    encode(message, writer = BinaryWriter.create()) {
        writer.uint32(10).fork();
        for (const v of message.unpausedPools) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgUnpauseByAlgorithmResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.unpausedPools.push(reader.uint64());
                        }
                    }
                    else {
                        message.unpausedPools.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            unpausedPools: Array.isArray(object?.unpausedPools)
                ? object.unpausedPools.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.unpausedPools) {
            obj.unpausedPools = message.unpausedPools.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.unpausedPools = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgUnpauseByAlgorithmResponse();
        message.unpausedPools =
            object.unpausedPools?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgUnpauseByAlgorithmResponse.decode(message.value);
    },
    toProto(message) {
        return MsgUnpauseByAlgorithmResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgUnpauseByAlgorithmResponse',
            value: MsgUnpauseByAlgorithmResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgUnpauseByPoolIds() {
    return {
        signer: '',
        poolIds: [],
    };
}
export const MsgUnpauseByPoolIds = {
    typeUrl: '/noble.swap.v1.MsgUnpauseByPoolIds',
    encode(message, writer = BinaryWriter.create()) {
        if (message.signer !== '') {
            writer.uint32(10).string(message.signer);
        }
        writer.uint32(18).fork();
        for (const v of message.poolIds) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgUnpauseByPoolIds();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.poolIds.push(reader.uint64());
                        }
                    }
                    else {
                        message.poolIds.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            poolIds: Array.isArray(object?.poolIds)
                ? object.poolIds.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        if (message.poolIds) {
            obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.poolIds = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgUnpauseByPoolIds();
        message.signer = object.signer ?? '';
        message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgUnpauseByPoolIds.decode(message.value);
    },
    toProto(message) {
        return MsgUnpauseByPoolIds.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgUnpauseByPoolIds',
            value: MsgUnpauseByPoolIds.encode(message).finish(),
        };
    },
};
function createBaseMsgUnpauseByPoolIdsResponse() {
    return {
        unpausedPools: [],
    };
}
export const MsgUnpauseByPoolIdsResponse = {
    typeUrl: '/noble.swap.v1.MsgUnpauseByPoolIdsResponse',
    encode(message, writer = BinaryWriter.create()) {
        writer.uint32(10).fork();
        for (const v of message.unpausedPools) {
            writer.uint64(v);
        }
        writer.ldelim();
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgUnpauseByPoolIdsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if ((tag & 7) === 2) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.unpausedPools.push(reader.uint64());
                        }
                    }
                    else {
                        message.unpausedPools.push(reader.uint64());
                    }
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            unpausedPools: Array.isArray(object?.unpausedPools)
                ? object.unpausedPools.map((e) => BigInt(e.toString()))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.unpausedPools) {
            obj.unpausedPools = message.unpausedPools.map(e => (e || BigInt(0)).toString());
        }
        else {
            obj.unpausedPools = [];
        }
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgUnpauseByPoolIdsResponse();
        message.unpausedPools =
            object.unpausedPools?.map(e => BigInt(e.toString())) || [];
        return message;
    },
    fromProtoMsg(message) {
        return MsgUnpauseByPoolIdsResponse.decode(message.value);
    },
    toProto(message) {
        return MsgUnpauseByPoolIdsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/noble.swap.v1.MsgUnpauseByPoolIdsResponse',
            value: MsgUnpauseByPoolIdsResponse.encode(message).finish(),
        };
    },
};
//# sourceMappingURL=tx.js.map