"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenReserve = void 0;
const helpers_1 = require("../../helpers");
const _m0 = __importStar(require("protobufjs/minimal"));
function createBaseTokenReserve() {
    return {
        assetId: 0,
        chainId: helpers_1.Long.UZERO,
        reservedAmount: "",
        tokenAddress: ""
    };
}
exports.TokenReserve = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.assetId !== 0) {
            writer.uint32(8).uint32(message.assetId);
        }
        if (!message.chainId.isZero()) {
            writer.uint32(16).uint64(message.chainId);
        }
        if (message.reservedAmount !== "") {
            writer.uint32(26).string(message.reservedAmount);
        }
        if (message.tokenAddress !== "") {
            writer.uint32(34).string(message.tokenAddress);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseTokenReserve();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.assetId = reader.uint32();
                    break;
                case 2:
                    message.chainId = reader.uint64();
                    break;
                case 3:
                    message.reservedAmount = reader.string();
                    break;
                case 4:
                    message.tokenAddress = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = createBaseTokenReserve();
        message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0;
        message.chainId = object.chainId !== undefined && object.chainId !== null ? helpers_1.Long.fromValue(object.chainId) : helpers_1.Long.UZERO;
        message.reservedAmount = (_b = object.reservedAmount) !== null && _b !== void 0 ? _b : "";
        message.tokenAddress = (_c = object.tokenAddress) !== null && _c !== void 0 ? _c : "";
        return message;
    }
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5fcmVzZXJ2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9Acml0Yml0L3Y0LXByb3RvL3NyYy9jb2RlZ2VuL3JpdGJpdC9icmlkZ2UvdG9rZW5fcmVzZXJ2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBa0Q7QUFDbEQsd0RBQTBDO0FBK0IxQyxTQUFTLHNCQUFzQjtJQUM3QixPQUFPO1FBQ0wsT0FBTyxFQUFFLENBQUM7UUFDVixPQUFPLEVBQUUsY0FBSSxDQUFDLEtBQUs7UUFDbkIsY0FBYyxFQUFFLEVBQUU7UUFDbEIsWUFBWSxFQUFFLEVBQUU7S0FDakIsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLFlBQVksR0FBRztJQUMxQixN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