PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@babylonlabs-io/babylon-proto-ts/dist/generated/babylon/btclightclient/v1
Просмотр файла: btclightclient.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/btclightclient/v1/btclightclient.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.BTCHeaderInfo = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
exports.protobufPackage = "babylon.btclightclient.v1";
function createBaseBTCHeaderInfo() {
return { header: new Uint8Array(0), hash: new Uint8Array(0), height: 0, work: new Uint8Array(0) };
}
exports.BTCHeaderInfo = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.header.length !== 0) {
writer.uint32(10).bytes(message.header);
}
if (message.hash.length !== 0) {
writer.uint32(18).bytes(message.hash);
}
if (message.height !== 0) {
writer.uint32(24).uint32(message.height);
}
if (message.work.length !== 0) {
writer.uint32(34).bytes(message.work);
}
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 = createBaseBTCHeaderInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.header = reader.bytes();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.hash = reader.bytes();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.height = reader.uint32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.work = reader.bytes();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header) ? bytesFromBase64(object.header) : new Uint8Array(0),
hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(0),
height: isSet(object.height) ? globalThis.Number(object.height) : 0,
work: isSet(object.work) ? bytesFromBase64(object.work) : new Uint8Array(0),
};
},
toJSON(message) {
const obj = {};
if (message.header.length !== 0) {
obj.header = base64FromBytes(message.header);
}
if (message.hash.length !== 0) {
obj.hash = base64FromBytes(message.hash);
}
if (message.height !== 0) {
obj.height = Math.round(message.height);
}
if (message.work.length !== 0) {
obj.work = base64FromBytes(message.work);
}
return obj;
},
create(base) {
return exports.BTCHeaderInfo.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c, _d;
const message = createBaseBTCHeaderInfo();
message.header = (_a = object.header) !== null && _a !== void 0 ? _a : new Uint8Array(0);
message.hash = (_b = object.hash) !== null && _b !== void 0 ? _b : new Uint8Array(0);
message.height = (_c = object.height) !== null && _c !== void 0 ? _c : 0;
message.work = (_d = object.work) !== null && _d !== void 0 ? _d : new Uint8Array(0);
return message;
},
};
function bytesFromBase64(b64) {
if (globalThis.Buffer) {
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
}
else {
const bin = globalThis.atob(b64);
const arr = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; ++i) {
arr[i] = bin.charCodeAt(i);
}
return arr;
}
}
function base64FromBytes(arr) {
if (globalThis.Buffer) {
return globalThis.Buffer.from(arr).toString("base64");
}
else {
const bin = [];
arr.forEach((byte) => {
bin.push(globalThis.String.fromCharCode(byte));
});
return globalThis.btoa(bin.join(""));
}
}
function isSet(value) {
return value !== null && value !== undefined;
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!