// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.178.0 // protoc v6.33.4 // source: signed.proto /* oxlint-disable */ import _m0 from "protobufjs/minimal.js"; export const protobufPackage = ""; export interface Signed { /** Signed contents */ payload: Uint8Array; /** The signature */ signature?: Uint8Array | undefined; } function createBaseSigned(): Signed { return { payload: new Uint8Array(0), signature: new Uint8Array(0) }; } export const Signed = { decode(input: _m0.Reader | Uint8Array, length?: number): Signed { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSigned(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.payload = reader.bytes(); continue; case 2: if (tag !== 18) { break; } message.signature = reader.bytes(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Signed { return { payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0), signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0), }; }, create, I>>(base?: I): Signed { return Signed.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Signed { const message = createBaseSigned(); message.payload = object.payload ?? new Uint8Array(0); message.signature = object.signature ?? new Uint8Array(0); return message; }, }; function bytesFromBase64(b64: string): Uint8Array { if ((globalThis as any).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; } } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function isSet(value: any): boolean { return value !== null && value !== undefined; }