PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@babylonlabs-io/babylon-proto-ts/dist/generated/babylon/epoching/v1

Просмотр файла: params.js

"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.6.1
//   protoc               unknown
// source: babylon/epoching/v1/params.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.Params = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
exports.protobufPackage = "babylon.epoching.v1";
function createBaseParams() {
    return { epochInterval: 0 };
}
exports.Params = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochInterval !== 0) {
            writer.uint32(8).uint64(message.epochInterval);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochInterval = longToNumber(reader.uint64());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { epochInterval: isSet(object.epochInterval) ? globalThis.Number(object.epochInterval) : 0 };
    },
    toJSON(message) {
        const obj = {};
        if (message.epochInterval !== 0) {
            obj.epochInterval = Math.round(message.epochInterval);
        }
        return obj;
    },
    create(base) {
        return exports.Params.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseParams();
        message.epochInterval = (_a = object.epochInterval) !== null && _a !== void 0 ? _a : 0;
        return message;
    },
};
function longToNumber(int64) {
    const num = globalThis.Number(int64.toString());
    if (num > globalThis.Number.MAX_SAFE_INTEGER) {
        throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
    }
    if (num < globalThis.Number.MIN_SAFE_INTEGER) {
        throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
    }
    return num;
}
function isSet(value) {
    return value !== null && value !== undefined;
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!