diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 342dea06..41fc56d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -114,6 +114,9 @@ jobs: working-directory: ./app run: yarn + - name: run check + run: make rpc-js-compile && make protos-check + - name: compile rpc for golang run: make rpc diff --git a/Makefile b/Makefile index c24f728b..9bc20e96 100644 --- a/Makefile +++ b/Makefile @@ -228,6 +228,10 @@ protos-check: protos @$(call print, "Verifying compiled protos.") if test -n "$$(git describe --dirty | grep dirty)"; then echo "Protos not properly formatted or not compiled with correct version"; git status; git diff; exit 1; fi +rpc-js-compile: + @$(call print, "Compiling JSON/WASM stubs.") + GOOS=js GOARCH=wasm $(GOBUILD) $(PKG)/litrpc + clean: @$(call print, "Cleaning source.$(NC)") $(RM) ./litcli-debug diff --git a/app/src/types/generated/lit-sessions_pb.d.ts b/app/src/types/generated/lit-sessions_pb.d.ts index 4b6a00d7..5b2b7bf8 100644 --- a/app/src/types/generated/lit-sessions_pb.d.ts +++ b/app/src/types/generated/lit-sessions_pb.d.ts @@ -96,6 +96,11 @@ export namespace AddSessionResponse { } export class Session extends jspb.Message { + getId(): Uint8Array | string; + getId_asU8(): Uint8Array; + getId_asB64(): string; + setId(value: Uint8Array | string): void; + getLabel(): string; setLabel(value: string): void; @@ -143,6 +148,8 @@ export class Session extends jspb.Message { getAccountId(): string; setAccountId(value: string): void; + getAutopilotFeatureInfoMap(): jspb.Map; + clearAutopilotFeatureInfoMap(): void; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Session.AsObject; static toObject(includeInstance: boolean, msg: Session): Session.AsObject; @@ -155,6 +162,7 @@ export class Session extends jspb.Message { export namespace Session { export type AsObject = { + id: Uint8Array | string, label: string, sessionState: SessionStateMap[keyof SessionStateMap], sessionType: SessionTypeMap[keyof SessionTypeMap], @@ -168,6 +176,7 @@ export namespace Session { createdAt: string, macaroonRecipe?: MacaroonRecipe.AsObject, accountId: string, + autopilotFeatureInfoMap: Array<[string, RulesMap.AsObject]>, } } @@ -275,11 +284,340 @@ export namespace RevokeSessionResponse { } } +export class RulesMap extends jspb.Message { + getRulesMap(): jspb.Map; + clearRulesMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RulesMap.AsObject; + static toObject(includeInstance: boolean, msg: RulesMap): RulesMap.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RulesMap, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RulesMap; + static deserializeBinaryFromReader(message: RulesMap, reader: jspb.BinaryReader): RulesMap; +} + +export namespace RulesMap { + export type AsObject = { + rulesMap: Array<[string, RuleValue.AsObject]>, + } +} + +export class RuleValue extends jspb.Message { + hasRateLimit(): boolean; + clearRateLimit(): void; + getRateLimit(): RateLimit | undefined; + setRateLimit(value?: RateLimit): void; + + hasChanPolicyBounds(): boolean; + clearChanPolicyBounds(): void; + getChanPolicyBounds(): ChannelPolicyBounds | undefined; + setChanPolicyBounds(value?: ChannelPolicyBounds): void; + + hasHistoryLimit(): boolean; + clearHistoryLimit(): void; + getHistoryLimit(): HistoryLimit | undefined; + setHistoryLimit(value?: HistoryLimit): void; + + hasOffChainBudget(): boolean; + clearOffChainBudget(): void; + getOffChainBudget(): OffChainBudget | undefined; + setOffChainBudget(value?: OffChainBudget): void; + + hasOnChainBudget(): boolean; + clearOnChainBudget(): void; + getOnChainBudget(): OnChainBudget | undefined; + setOnChainBudget(value?: OnChainBudget): void; + + hasSendToSelf(): boolean; + clearSendToSelf(): void; + getSendToSelf(): SendToSelf | undefined; + setSendToSelf(value?: SendToSelf): void; + + hasChannelRestrict(): boolean; + clearChannelRestrict(): void; + getChannelRestrict(): ChannelRestrict | undefined; + setChannelRestrict(value?: ChannelRestrict): void; + + hasPeerRestrict(): boolean; + clearPeerRestrict(): void; + getPeerRestrict(): PeerRestrict | undefined; + setPeerRestrict(value?: PeerRestrict): void; + + getValueCase(): RuleValue.ValueCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RuleValue.AsObject; + static toObject(includeInstance: boolean, msg: RuleValue): RuleValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RuleValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RuleValue; + static deserializeBinaryFromReader(message: RuleValue, reader: jspb.BinaryReader): RuleValue; +} + +export namespace RuleValue { + export type AsObject = { + rateLimit?: RateLimit.AsObject, + chanPolicyBounds?: ChannelPolicyBounds.AsObject, + historyLimit?: HistoryLimit.AsObject, + offChainBudget?: OffChainBudget.AsObject, + onChainBudget?: OnChainBudget.AsObject, + sendToSelf?: SendToSelf.AsObject, + channelRestrict?: ChannelRestrict.AsObject, + peerRestrict?: PeerRestrict.AsObject, + } + + export enum ValueCase { + VALUE_NOT_SET = 0, + RATE_LIMIT = 1, + CHAN_POLICY_BOUNDS = 2, + HISTORY_LIMIT = 3, + OFF_CHAIN_BUDGET = 4, + ON_CHAIN_BUDGET = 5, + SEND_TO_SELF = 6, + CHANNEL_RESTRICT = 7, + PEER_RESTRICT = 8, + } +} + +export class RateLimit extends jspb.Message { + hasReadLimit(): boolean; + clearReadLimit(): void; + getReadLimit(): Rate | undefined; + setReadLimit(value?: Rate): void; + + hasWriteLimit(): boolean; + clearWriteLimit(): void; + getWriteLimit(): Rate | undefined; + setWriteLimit(value?: Rate): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RateLimit.AsObject; + static toObject(includeInstance: boolean, msg: RateLimit): RateLimit.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RateLimit, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RateLimit; + static deserializeBinaryFromReader(message: RateLimit, reader: jspb.BinaryReader): RateLimit; +} + +export namespace RateLimit { + export type AsObject = { + readLimit?: Rate.AsObject, + writeLimit?: Rate.AsObject, + } +} + +export class Rate extends jspb.Message { + getIterations(): number; + setIterations(value: number): void; + + getNumHours(): number; + setNumHours(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Rate.AsObject; + static toObject(includeInstance: boolean, msg: Rate): Rate.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Rate, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Rate; + static deserializeBinaryFromReader(message: Rate, reader: jspb.BinaryReader): Rate; +} + +export namespace Rate { + export type AsObject = { + iterations: number, + numHours: number, + } +} + +export class HistoryLimit extends jspb.Message { + getStartTime(): string; + setStartTime(value: string): void; + + getDuration(): string; + setDuration(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HistoryLimit.AsObject; + static toObject(includeInstance: boolean, msg: HistoryLimit): HistoryLimit.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HistoryLimit, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HistoryLimit; + static deserializeBinaryFromReader(message: HistoryLimit, reader: jspb.BinaryReader): HistoryLimit; +} + +export namespace HistoryLimit { + export type AsObject = { + startTime: string, + duration: string, + } +} + +export class ChannelPolicyBounds extends jspb.Message { + getMinBaseMsat(): string; + setMinBaseMsat(value: string): void; + + getMaxBaseMsat(): string; + setMaxBaseMsat(value: string): void; + + getMinRatePpm(): number; + setMinRatePpm(value: number): void; + + getMaxRatePpm(): number; + setMaxRatePpm(value: number): void; + + getMinCltvDelta(): number; + setMinCltvDelta(value: number): void; + + getMaxCltvDelta(): number; + setMaxCltvDelta(value: number): void; + + getMinHtlcMsat(): string; + setMinHtlcMsat(value: string): void; + + getMaxHtlcMsat(): string; + setMaxHtlcMsat(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChannelPolicyBounds.AsObject; + static toObject(includeInstance: boolean, msg: ChannelPolicyBounds): ChannelPolicyBounds.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChannelPolicyBounds, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChannelPolicyBounds; + static deserializeBinaryFromReader(message: ChannelPolicyBounds, reader: jspb.BinaryReader): ChannelPolicyBounds; +} + +export namespace ChannelPolicyBounds { + export type AsObject = { + minBaseMsat: string, + maxBaseMsat: string, + minRatePpm: number, + maxRatePpm: number, + minCltvDelta: number, + maxCltvDelta: number, + minHtlcMsat: string, + maxHtlcMsat: string, + } +} + +export class OffChainBudget extends jspb.Message { + getMaxAmtMsat(): string; + setMaxAmtMsat(value: string): void; + + getMaxFeesMsat(): string; + setMaxFeesMsat(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): OffChainBudget.AsObject; + static toObject(includeInstance: boolean, msg: OffChainBudget): OffChainBudget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: OffChainBudget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): OffChainBudget; + static deserializeBinaryFromReader(message: OffChainBudget, reader: jspb.BinaryReader): OffChainBudget; +} + +export namespace OffChainBudget { + export type AsObject = { + maxAmtMsat: string, + maxFeesMsat: string, + } +} + +export class OnChainBudget extends jspb.Message { + getAbsoluteAmtSats(): string; + setAbsoluteAmtSats(value: string): void; + + getMaxSatPerVByte(): string; + setMaxSatPerVByte(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): OnChainBudget.AsObject; + static toObject(includeInstance: boolean, msg: OnChainBudget): OnChainBudget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: OnChainBudget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): OnChainBudget; + static deserializeBinaryFromReader(message: OnChainBudget, reader: jspb.BinaryReader): OnChainBudget; +} + +export namespace OnChainBudget { + export type AsObject = { + absoluteAmtSats: string, + maxSatPerVByte: string, + } +} + +export class SendToSelf extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SendToSelf.AsObject; + static toObject(includeInstance: boolean, msg: SendToSelf): SendToSelf.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SendToSelf, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SendToSelf; + static deserializeBinaryFromReader(message: SendToSelf, reader: jspb.BinaryReader): SendToSelf; +} + +export namespace SendToSelf { + export type AsObject = { + } +} + +export class ChannelRestrict extends jspb.Message { + clearChannelIdsList(): void; + getChannelIdsList(): Array; + setChannelIdsList(value: Array): void; + addChannelIds(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ChannelRestrict.AsObject; + static toObject(includeInstance: boolean, msg: ChannelRestrict): ChannelRestrict.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ChannelRestrict, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ChannelRestrict; + static deserializeBinaryFromReader(message: ChannelRestrict, reader: jspb.BinaryReader): ChannelRestrict; +} + +export namespace ChannelRestrict { + export type AsObject = { + channelIdsList: Array, + } +} + +export class PeerRestrict extends jspb.Message { + clearPeerIdsList(): void; + getPeerIdsList(): Array; + setPeerIdsList(value: Array): void; + addPeerIds(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PeerRestrict.AsObject; + static toObject(includeInstance: boolean, msg: PeerRestrict): PeerRestrict.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PeerRestrict, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PeerRestrict; + static deserializeBinaryFromReader(message: PeerRestrict, reader: jspb.BinaryReader): PeerRestrict; +} + +export namespace PeerRestrict { + export type AsObject = { + peerIdsList: Array, + } +} + export interface SessionTypeMap { TYPE_MACAROON_READONLY: 0; TYPE_MACAROON_ADMIN: 1; TYPE_MACAROON_CUSTOM: 2; TYPE_UI_PASSWORD: 3; + TYPE_AUTOPILOT: 4; TYPE_MACAROON_ACCOUNT: 5; } diff --git a/app/src/types/generated/lit-sessions_pb.js b/app/src/types/generated/lit-sessions_pb.js index 82730227..81a67cac 100644 --- a/app/src/types/generated/lit-sessions_pb.js +++ b/app/src/types/generated/lit-sessions_pb.js @@ -16,12 +16,23 @@ var global = Function('return this')(); goog.exportSymbol('proto.litrpc.AddSessionRequest', null, global); goog.exportSymbol('proto.litrpc.AddSessionResponse', null, global); +goog.exportSymbol('proto.litrpc.ChannelPolicyBounds', null, global); +goog.exportSymbol('proto.litrpc.ChannelRestrict', null, global); +goog.exportSymbol('proto.litrpc.HistoryLimit', null, global); goog.exportSymbol('proto.litrpc.ListSessionsRequest', null, global); goog.exportSymbol('proto.litrpc.ListSessionsResponse', null, global); goog.exportSymbol('proto.litrpc.MacaroonPermission', null, global); goog.exportSymbol('proto.litrpc.MacaroonRecipe', null, global); +goog.exportSymbol('proto.litrpc.OffChainBudget', null, global); +goog.exportSymbol('proto.litrpc.OnChainBudget', null, global); +goog.exportSymbol('proto.litrpc.PeerRestrict', null, global); +goog.exportSymbol('proto.litrpc.Rate', null, global); +goog.exportSymbol('proto.litrpc.RateLimit', null, global); goog.exportSymbol('proto.litrpc.RevokeSessionRequest', null, global); goog.exportSymbol('proto.litrpc.RevokeSessionResponse', null, global); +goog.exportSymbol('proto.litrpc.RuleValue', null, global); +goog.exportSymbol('proto.litrpc.RulesMap', null, global); +goog.exportSymbol('proto.litrpc.SendToSelf', null, global); goog.exportSymbol('proto.litrpc.Session', null, global); goog.exportSymbol('proto.litrpc.SessionState', null, global); goog.exportSymbol('proto.litrpc.SessionType', null, global); @@ -732,6 +743,7 @@ proto.litrpc.Session.prototype.toObject = function(opt_includeInstance) { */ proto.litrpc.Session.toObject = function(includeInstance, msg) { var f, obj = { + id: msg.getId_asB64(), label: jspb.Message.getFieldWithDefault(msg, 1, ""), sessionState: jspb.Message.getFieldWithDefault(msg, 2, 0), sessionType: jspb.Message.getFieldWithDefault(msg, 3, 0), @@ -744,7 +756,8 @@ proto.litrpc.Session.toObject = function(includeInstance, msg) { remotePublicKey: msg.getRemotePublicKey_asB64(), createdAt: jspb.Message.getFieldWithDefault(msg, 11, "0"), macaroonRecipe: (f = msg.getMacaroonRecipe()) && proto.litrpc.MacaroonRecipe.toObject(includeInstance, f), - accountId: jspb.Message.getFieldWithDefault(msg, 13, "") + accountId: jspb.Message.getFieldWithDefault(msg, 13, ""), + autopilotFeatureInfoMap: (f = msg.getAutopilotFeatureInfoMap()) ? f.toObject(includeInstance, proto.litrpc.RulesMap.toObject) : [] }; if (includeInstance) { @@ -781,6 +794,10 @@ proto.litrpc.Session.deserializeBinaryFromReader = function(msg, reader) { } var field = reader.getFieldNumber(); switch (field) { + case 14: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; case 1: var value = /** @type {string} */ (reader.readString()); msg.setLabel(value); @@ -834,6 +851,12 @@ proto.litrpc.Session.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {string} */ (reader.readString()); msg.setAccountId(value); break; + case 15: + var value = msg.getAutopilotFeatureInfoMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.litrpc.RulesMap.deserializeBinaryFromReader, ""); + }); + break; default: reader.skipField(); break; @@ -863,6 +886,13 @@ proto.litrpc.Session.prototype.serializeBinary = function() { */ proto.litrpc.Session.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 14, + f + ); + } f = message.getLabel(); if (f.length > 0) { writer.writeString( @@ -955,6 +985,49 @@ proto.litrpc.Session.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getAutopilotFeatureInfoMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.litrpc.RulesMap.serializeBinaryToWriter); + } +}; + + +/** + * optional bytes id = 14; + * @return {!(string|Uint8Array)} + */ +proto.litrpc.Session.prototype.getId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 14, "")); +}; + + +/** + * optional bytes id = 14; + * This is a type-conversion wrapper around `getId()` + * @return {string} + */ +proto.litrpc.Session.prototype.getId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getId())); +}; + + +/** + * optional bytes id = 14; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getId()` + * @return {!Uint8Array} + */ +proto.litrpc.Session.prototype.getId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.litrpc.Session.prototype.setId = function(value) { + jspb.Message.setProto3BytesField(this, 14, value); }; @@ -1242,6 +1315,24 @@ proto.litrpc.Session.prototype.setAccountId = function(value) { }; +/** + * map autopilot_feature_info = 15; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.litrpc.Session.prototype.getAutopilotFeatureInfoMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 15, opt_noLazyCreate, + proto.litrpc.RulesMap)); +}; + + +proto.litrpc.Session.prototype.clearAutopilotFeatureInfoMap = function() { + this.getAutopilotFeatureInfoMap().clear(); +}; + + /** * Generated by JsPbCodeGenerator. @@ -2017,6 +2108,2301 @@ proto.litrpc.RevokeSessionResponse.serializeBinaryToWriter = function(message, w }; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.RulesMap = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.RulesMap, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.RulesMap.displayName = 'proto.litrpc.RulesMap'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.RulesMap.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.RulesMap.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.RulesMap} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RulesMap.toObject = function(includeInstance, msg) { + var f, obj = { + rulesMap: (f = msg.getRulesMap()) ? f.toObject(includeInstance, proto.litrpc.RuleValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.RulesMap} + */ +proto.litrpc.RulesMap.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.RulesMap; + return proto.litrpc.RulesMap.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.RulesMap} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.RulesMap} + */ +proto.litrpc.RulesMap.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getRulesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.litrpc.RuleValue.deserializeBinaryFromReader, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.RulesMap.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.RulesMap.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.RulesMap} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RulesMap.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRulesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.litrpc.RuleValue.serializeBinaryToWriter); + } +}; + + +/** + * map rules = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.litrpc.RulesMap.prototype.getRulesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.litrpc.RuleValue)); +}; + + +proto.litrpc.RulesMap.prototype.clearRulesMap = function() { + this.getRulesMap().clear(); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.RuleValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.litrpc.RuleValue.oneofGroups_); +}; +goog.inherits(proto.litrpc.RuleValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.RuleValue.displayName = 'proto.litrpc.RuleValue'; +} +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.litrpc.RuleValue.oneofGroups_ = [[1,2,3,4,5,6,7,8]]; + +/** + * @enum {number} + */ +proto.litrpc.RuleValue.ValueCase = { + VALUE_NOT_SET: 0, + RATE_LIMIT: 1, + CHAN_POLICY_BOUNDS: 2, + HISTORY_LIMIT: 3, + OFF_CHAIN_BUDGET: 4, + ON_CHAIN_BUDGET: 5, + SEND_TO_SELF: 6, + CHANNEL_RESTRICT: 7, + PEER_RESTRICT: 8 +}; + +/** + * @return {proto.litrpc.RuleValue.ValueCase} + */ +proto.litrpc.RuleValue.prototype.getValueCase = function() { + return /** @type {proto.litrpc.RuleValue.ValueCase} */(jspb.Message.computeOneofCase(this, proto.litrpc.RuleValue.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.RuleValue.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.RuleValue.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.RuleValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RuleValue.toObject = function(includeInstance, msg) { + var f, obj = { + rateLimit: (f = msg.getRateLimit()) && proto.litrpc.RateLimit.toObject(includeInstance, f), + chanPolicyBounds: (f = msg.getChanPolicyBounds()) && proto.litrpc.ChannelPolicyBounds.toObject(includeInstance, f), + historyLimit: (f = msg.getHistoryLimit()) && proto.litrpc.HistoryLimit.toObject(includeInstance, f), + offChainBudget: (f = msg.getOffChainBudget()) && proto.litrpc.OffChainBudget.toObject(includeInstance, f), + onChainBudget: (f = msg.getOnChainBudget()) && proto.litrpc.OnChainBudget.toObject(includeInstance, f), + sendToSelf: (f = msg.getSendToSelf()) && proto.litrpc.SendToSelf.toObject(includeInstance, f), + channelRestrict: (f = msg.getChannelRestrict()) && proto.litrpc.ChannelRestrict.toObject(includeInstance, f), + peerRestrict: (f = msg.getPeerRestrict()) && proto.litrpc.PeerRestrict.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.RuleValue} + */ +proto.litrpc.RuleValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.RuleValue; + return proto.litrpc.RuleValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.RuleValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.RuleValue} + */ +proto.litrpc.RuleValue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.litrpc.RateLimit; + reader.readMessage(value,proto.litrpc.RateLimit.deserializeBinaryFromReader); + msg.setRateLimit(value); + break; + case 2: + var value = new proto.litrpc.ChannelPolicyBounds; + reader.readMessage(value,proto.litrpc.ChannelPolicyBounds.deserializeBinaryFromReader); + msg.setChanPolicyBounds(value); + break; + case 3: + var value = new proto.litrpc.HistoryLimit; + reader.readMessage(value,proto.litrpc.HistoryLimit.deserializeBinaryFromReader); + msg.setHistoryLimit(value); + break; + case 4: + var value = new proto.litrpc.OffChainBudget; + reader.readMessage(value,proto.litrpc.OffChainBudget.deserializeBinaryFromReader); + msg.setOffChainBudget(value); + break; + case 5: + var value = new proto.litrpc.OnChainBudget; + reader.readMessage(value,proto.litrpc.OnChainBudget.deserializeBinaryFromReader); + msg.setOnChainBudget(value); + break; + case 6: + var value = new proto.litrpc.SendToSelf; + reader.readMessage(value,proto.litrpc.SendToSelf.deserializeBinaryFromReader); + msg.setSendToSelf(value); + break; + case 7: + var value = new proto.litrpc.ChannelRestrict; + reader.readMessage(value,proto.litrpc.ChannelRestrict.deserializeBinaryFromReader); + msg.setChannelRestrict(value); + break; + case 8: + var value = new proto.litrpc.PeerRestrict; + reader.readMessage(value,proto.litrpc.PeerRestrict.deserializeBinaryFromReader); + msg.setPeerRestrict(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.RuleValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.RuleValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.RuleValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RuleValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRateLimit(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.litrpc.RateLimit.serializeBinaryToWriter + ); + } + f = message.getChanPolicyBounds(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.litrpc.ChannelPolicyBounds.serializeBinaryToWriter + ); + } + f = message.getHistoryLimit(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.litrpc.HistoryLimit.serializeBinaryToWriter + ); + } + f = message.getOffChainBudget(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.litrpc.OffChainBudget.serializeBinaryToWriter + ); + } + f = message.getOnChainBudget(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.litrpc.OnChainBudget.serializeBinaryToWriter + ); + } + f = message.getSendToSelf(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.litrpc.SendToSelf.serializeBinaryToWriter + ); + } + f = message.getChannelRestrict(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.litrpc.ChannelRestrict.serializeBinaryToWriter + ); + } + f = message.getPeerRestrict(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.litrpc.PeerRestrict.serializeBinaryToWriter + ); + } +}; + + +/** + * optional RateLimit rate_limit = 1; + * @return {?proto.litrpc.RateLimit} + */ +proto.litrpc.RuleValue.prototype.getRateLimit = function() { + return /** @type{?proto.litrpc.RateLimit} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.RateLimit, 1)); +}; + + +/** @param {?proto.litrpc.RateLimit|undefined} value */ +proto.litrpc.RuleValue.prototype.setRateLimit = function(value) { + jspb.Message.setOneofWrapperField(this, 1, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearRateLimit = function() { + this.setRateLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasRateLimit = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ChannelPolicyBounds chan_policy_bounds = 2; + * @return {?proto.litrpc.ChannelPolicyBounds} + */ +proto.litrpc.RuleValue.prototype.getChanPolicyBounds = function() { + return /** @type{?proto.litrpc.ChannelPolicyBounds} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.ChannelPolicyBounds, 2)); +}; + + +/** @param {?proto.litrpc.ChannelPolicyBounds|undefined} value */ +proto.litrpc.RuleValue.prototype.setChanPolicyBounds = function(value) { + jspb.Message.setOneofWrapperField(this, 2, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearChanPolicyBounds = function() { + this.setChanPolicyBounds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasChanPolicyBounds = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional HistoryLimit history_limit = 3; + * @return {?proto.litrpc.HistoryLimit} + */ +proto.litrpc.RuleValue.prototype.getHistoryLimit = function() { + return /** @type{?proto.litrpc.HistoryLimit} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.HistoryLimit, 3)); +}; + + +/** @param {?proto.litrpc.HistoryLimit|undefined} value */ +proto.litrpc.RuleValue.prototype.setHistoryLimit = function(value) { + jspb.Message.setOneofWrapperField(this, 3, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearHistoryLimit = function() { + this.setHistoryLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasHistoryLimit = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional OffChainBudget off_chain_budget = 4; + * @return {?proto.litrpc.OffChainBudget} + */ +proto.litrpc.RuleValue.prototype.getOffChainBudget = function() { + return /** @type{?proto.litrpc.OffChainBudget} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.OffChainBudget, 4)); +}; + + +/** @param {?proto.litrpc.OffChainBudget|undefined} value */ +proto.litrpc.RuleValue.prototype.setOffChainBudget = function(value) { + jspb.Message.setOneofWrapperField(this, 4, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearOffChainBudget = function() { + this.setOffChainBudget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasOffChainBudget = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional OnChainBudget on_chain_budget = 5; + * @return {?proto.litrpc.OnChainBudget} + */ +proto.litrpc.RuleValue.prototype.getOnChainBudget = function() { + return /** @type{?proto.litrpc.OnChainBudget} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.OnChainBudget, 5)); +}; + + +/** @param {?proto.litrpc.OnChainBudget|undefined} value */ +proto.litrpc.RuleValue.prototype.setOnChainBudget = function(value) { + jspb.Message.setOneofWrapperField(this, 5, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearOnChainBudget = function() { + this.setOnChainBudget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasOnChainBudget = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional SendToSelf send_to_self = 6; + * @return {?proto.litrpc.SendToSelf} + */ +proto.litrpc.RuleValue.prototype.getSendToSelf = function() { + return /** @type{?proto.litrpc.SendToSelf} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.SendToSelf, 6)); +}; + + +/** @param {?proto.litrpc.SendToSelf|undefined} value */ +proto.litrpc.RuleValue.prototype.setSendToSelf = function(value) { + jspb.Message.setOneofWrapperField(this, 6, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearSendToSelf = function() { + this.setSendToSelf(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasSendToSelf = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional ChannelRestrict channel_restrict = 7; + * @return {?proto.litrpc.ChannelRestrict} + */ +proto.litrpc.RuleValue.prototype.getChannelRestrict = function() { + return /** @type{?proto.litrpc.ChannelRestrict} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.ChannelRestrict, 7)); +}; + + +/** @param {?proto.litrpc.ChannelRestrict|undefined} value */ +proto.litrpc.RuleValue.prototype.setChannelRestrict = function(value) { + jspb.Message.setOneofWrapperField(this, 7, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearChannelRestrict = function() { + this.setChannelRestrict(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasChannelRestrict = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional PeerRestrict peer_restrict = 8; + * @return {?proto.litrpc.PeerRestrict} + */ +proto.litrpc.RuleValue.prototype.getPeerRestrict = function() { + return /** @type{?proto.litrpc.PeerRestrict} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.PeerRestrict, 8)); +}; + + +/** @param {?proto.litrpc.PeerRestrict|undefined} value */ +proto.litrpc.RuleValue.prototype.setPeerRestrict = function(value) { + jspb.Message.setOneofWrapperField(this, 8, proto.litrpc.RuleValue.oneofGroups_[0], value); +}; + + +proto.litrpc.RuleValue.prototype.clearPeerRestrict = function() { + this.setPeerRestrict(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RuleValue.prototype.hasPeerRestrict = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.RateLimit = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.RateLimit, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.RateLimit.displayName = 'proto.litrpc.RateLimit'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.RateLimit.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.RateLimit.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.RateLimit} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RateLimit.toObject = function(includeInstance, msg) { + var f, obj = { + readLimit: (f = msg.getReadLimit()) && proto.litrpc.Rate.toObject(includeInstance, f), + writeLimit: (f = msg.getWriteLimit()) && proto.litrpc.Rate.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.RateLimit} + */ +proto.litrpc.RateLimit.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.RateLimit; + return proto.litrpc.RateLimit.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.RateLimit} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.RateLimit} + */ +proto.litrpc.RateLimit.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.litrpc.Rate; + reader.readMessage(value,proto.litrpc.Rate.deserializeBinaryFromReader); + msg.setReadLimit(value); + break; + case 2: + var value = new proto.litrpc.Rate; + reader.readMessage(value,proto.litrpc.Rate.deserializeBinaryFromReader); + msg.setWriteLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.RateLimit.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.RateLimit.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.RateLimit} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.RateLimit.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReadLimit(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.litrpc.Rate.serializeBinaryToWriter + ); + } + f = message.getWriteLimit(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.litrpc.Rate.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Rate read_limit = 1; + * @return {?proto.litrpc.Rate} + */ +proto.litrpc.RateLimit.prototype.getReadLimit = function() { + return /** @type{?proto.litrpc.Rate} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.Rate, 1)); +}; + + +/** @param {?proto.litrpc.Rate|undefined} value */ +proto.litrpc.RateLimit.prototype.setReadLimit = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.litrpc.RateLimit.prototype.clearReadLimit = function() { + this.setReadLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RateLimit.prototype.hasReadLimit = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Rate write_limit = 2; + * @return {?proto.litrpc.Rate} + */ +proto.litrpc.RateLimit.prototype.getWriteLimit = function() { + return /** @type{?proto.litrpc.Rate} */ ( + jspb.Message.getWrapperField(this, proto.litrpc.Rate, 2)); +}; + + +/** @param {?proto.litrpc.Rate|undefined} value */ +proto.litrpc.RateLimit.prototype.setWriteLimit = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.litrpc.RateLimit.prototype.clearWriteLimit = function() { + this.setWriteLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.litrpc.RateLimit.prototype.hasWriteLimit = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.Rate = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.Rate, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.Rate.displayName = 'proto.litrpc.Rate'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.Rate.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.Rate.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.Rate} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.Rate.toObject = function(includeInstance, msg) { + var f, obj = { + iterations: jspb.Message.getFieldWithDefault(msg, 1, 0), + numHours: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.Rate} + */ +proto.litrpc.Rate.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.Rate; + return proto.litrpc.Rate.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.Rate} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.Rate} + */ +proto.litrpc.Rate.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setIterations(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setNumHours(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.Rate.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.Rate.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.Rate} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.Rate.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIterations(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getNumHours(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional uint32 iterations = 1; + * @return {number} + */ +proto.litrpc.Rate.prototype.getIterations = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.Rate.prototype.setIterations = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 num_hours = 2; + * @return {number} + */ +proto.litrpc.Rate.prototype.getNumHours = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.Rate.prototype.setNumHours = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.HistoryLimit = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.HistoryLimit, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.HistoryLimit.displayName = 'proto.litrpc.HistoryLimit'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.HistoryLimit.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.HistoryLimit.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.HistoryLimit} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.HistoryLimit.toObject = function(includeInstance, msg) { + var f, obj = { + startTime: jspb.Message.getFieldWithDefault(msg, 1, "0"), + duration: jspb.Message.getFieldWithDefault(msg, 2, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.HistoryLimit} + */ +proto.litrpc.HistoryLimit.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.HistoryLimit; + return proto.litrpc.HistoryLimit.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.HistoryLimit} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.HistoryLimit} + */ +proto.litrpc.HistoryLimit.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setStartTime(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setDuration(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.HistoryLimit.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.HistoryLimit.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.HistoryLimit} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.HistoryLimit.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStartTime(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getDuration(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } +}; + + +/** + * optional uint64 start_time = 1; + * @return {string} + */ +proto.litrpc.HistoryLimit.prototype.getStartTime = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.HistoryLimit.prototype.setStartTime = function(value) { + jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 duration = 2; + * @return {string} + */ +proto.litrpc.HistoryLimit.prototype.getDuration = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.HistoryLimit.prototype.setDuration = function(value) { + jspb.Message.setProto3StringIntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.ChannelPolicyBounds = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.ChannelPolicyBounds, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.ChannelPolicyBounds.displayName = 'proto.litrpc.ChannelPolicyBounds'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.ChannelPolicyBounds.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.ChannelPolicyBounds.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.ChannelPolicyBounds} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.ChannelPolicyBounds.toObject = function(includeInstance, msg) { + var f, obj = { + minBaseMsat: jspb.Message.getFieldWithDefault(msg, 1, "0"), + maxBaseMsat: jspb.Message.getFieldWithDefault(msg, 2, "0"), + minRatePpm: jspb.Message.getFieldWithDefault(msg, 3, 0), + maxRatePpm: jspb.Message.getFieldWithDefault(msg, 4, 0), + minCltvDelta: jspb.Message.getFieldWithDefault(msg, 5, 0), + maxCltvDelta: jspb.Message.getFieldWithDefault(msg, 6, 0), + minHtlcMsat: jspb.Message.getFieldWithDefault(msg, 7, "0"), + maxHtlcMsat: jspb.Message.getFieldWithDefault(msg, 8, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.ChannelPolicyBounds} + */ +proto.litrpc.ChannelPolicyBounds.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.ChannelPolicyBounds; + return proto.litrpc.ChannelPolicyBounds.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.ChannelPolicyBounds} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.ChannelPolicyBounds} + */ +proto.litrpc.ChannelPolicyBounds.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMinBaseMsat(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMaxBaseMsat(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setMinRatePpm(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setMaxRatePpm(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint32()); + msg.setMinCltvDelta(value); + break; + case 6: + var value = /** @type {number} */ (reader.readUint32()); + msg.setMaxCltvDelta(value); + break; + case 7: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMinHtlcMsat(value); + break; + case 8: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMaxHtlcMsat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.ChannelPolicyBounds.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.ChannelPolicyBounds.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.ChannelPolicyBounds} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.ChannelPolicyBounds.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMinBaseMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getMaxBaseMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } + f = message.getMinRatePpm(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getMaxRatePpm(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } + f = message.getMinCltvDelta(); + if (f !== 0) { + writer.writeUint32( + 5, + f + ); + } + f = message.getMaxCltvDelta(); + if (f !== 0) { + writer.writeUint32( + 6, + f + ); + } + f = message.getMinHtlcMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 7, + f + ); + } + f = message.getMaxHtlcMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 8, + f + ); + } +}; + + +/** + * optional uint64 min_base_msat = 1; + * @return {string} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMinBaseMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMinBaseMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 max_base_msat = 2; + * @return {string} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMaxBaseMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMaxBaseMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 2, value); +}; + + +/** + * optional uint32 min_rate_ppm = 3; + * @return {number} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMinRatePpm = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMinRatePpm = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint32 max_rate_ppm = 4; + * @return {number} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMaxRatePpm = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMaxRatePpm = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional uint32 min_cltv_delta = 5; + * @return {number} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMinCltvDelta = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMinCltvDelta = function(value) { + jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional uint32 max_cltv_delta = 6; + * @return {number} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMaxCltvDelta = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMaxCltvDelta = function(value) { + jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional uint64 min_htlc_msat = 7; + * @return {string} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMinHtlcMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMinHtlcMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 7, value); +}; + + +/** + * optional uint64 max_htlc_msat = 8; + * @return {string} + */ +proto.litrpc.ChannelPolicyBounds.prototype.getMaxHtlcMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.ChannelPolicyBounds.prototype.setMaxHtlcMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 8, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.OffChainBudget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.OffChainBudget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.OffChainBudget.displayName = 'proto.litrpc.OffChainBudget'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.OffChainBudget.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.OffChainBudget.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.OffChainBudget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.OffChainBudget.toObject = function(includeInstance, msg) { + var f, obj = { + maxAmtMsat: jspb.Message.getFieldWithDefault(msg, 1, "0"), + maxFeesMsat: jspb.Message.getFieldWithDefault(msg, 2, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.OffChainBudget} + */ +proto.litrpc.OffChainBudget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.OffChainBudget; + return proto.litrpc.OffChainBudget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.OffChainBudget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.OffChainBudget} + */ +proto.litrpc.OffChainBudget.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMaxAmtMsat(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMaxFeesMsat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.OffChainBudget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.OffChainBudget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.OffChainBudget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.OffChainBudget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMaxAmtMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getMaxFeesMsat(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } +}; + + +/** + * optional uint64 max_amt_msat = 1; + * @return {string} + */ +proto.litrpc.OffChainBudget.prototype.getMaxAmtMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.OffChainBudget.prototype.setMaxAmtMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 max_fees_msat = 2; + * @return {string} + */ +proto.litrpc.OffChainBudget.prototype.getMaxFeesMsat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.OffChainBudget.prototype.setMaxFeesMsat = function(value) { + jspb.Message.setProto3StringIntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.OnChainBudget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.OnChainBudget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.OnChainBudget.displayName = 'proto.litrpc.OnChainBudget'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.OnChainBudget.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.OnChainBudget.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.OnChainBudget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.OnChainBudget.toObject = function(includeInstance, msg) { + var f, obj = { + absoluteAmtSats: jspb.Message.getFieldWithDefault(msg, 1, "0"), + maxSatPerVByte: jspb.Message.getFieldWithDefault(msg, 2, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.OnChainBudget} + */ +proto.litrpc.OnChainBudget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.OnChainBudget; + return proto.litrpc.OnChainBudget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.OnChainBudget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.OnChainBudget} + */ +proto.litrpc.OnChainBudget.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setAbsoluteAmtSats(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setMaxSatPerVByte(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.OnChainBudget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.OnChainBudget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.OnChainBudget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.OnChainBudget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAbsoluteAmtSats(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getMaxSatPerVByte(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } +}; + + +/** + * optional uint64 absolute_amt_sats = 1; + * @return {string} + */ +proto.litrpc.OnChainBudget.prototype.getAbsoluteAmtSats = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.OnChainBudget.prototype.setAbsoluteAmtSats = function(value) { + jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 max_sat_per_v_byte = 2; + * @return {string} + */ +proto.litrpc.OnChainBudget.prototype.getMaxSatPerVByte = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** @param {string} value */ +proto.litrpc.OnChainBudget.prototype.setMaxSatPerVByte = function(value) { + jspb.Message.setProto3StringIntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.SendToSelf = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.litrpc.SendToSelf, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.SendToSelf.displayName = 'proto.litrpc.SendToSelf'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.SendToSelf.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.SendToSelf.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.SendToSelf} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.SendToSelf.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.SendToSelf} + */ +proto.litrpc.SendToSelf.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.SendToSelf; + return proto.litrpc.SendToSelf.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.SendToSelf} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.SendToSelf} + */ +proto.litrpc.SendToSelf.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.SendToSelf.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.SendToSelf.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.SendToSelf} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.SendToSelf.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.ChannelRestrict = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.litrpc.ChannelRestrict.repeatedFields_, null); +}; +goog.inherits(proto.litrpc.ChannelRestrict, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.ChannelRestrict.displayName = 'proto.litrpc.ChannelRestrict'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.litrpc.ChannelRestrict.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.ChannelRestrict.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.ChannelRestrict.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.ChannelRestrict} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.ChannelRestrict.toObject = function(includeInstance, msg) { + var f, obj = { + channelIdsList: jspb.Message.getRepeatedField(msg, 1) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.ChannelRestrict} + */ +proto.litrpc.ChannelRestrict.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.ChannelRestrict; + return proto.litrpc.ChannelRestrict.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.ChannelRestrict} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.ChannelRestrict} + */ +proto.litrpc.ChannelRestrict.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Array} */ (reader.readPackedUint64String()); + msg.setChannelIdsList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.ChannelRestrict.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.ChannelRestrict.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.ChannelRestrict} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.ChannelRestrict.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChannelIdsList(); + if (f.length > 0) { + writer.writePackedUint64String( + 1, + f + ); + } +}; + + +/** + * repeated uint64 channel_ids = 1; + * @return {!Array} + */ +proto.litrpc.ChannelRestrict.prototype.getChannelIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.litrpc.ChannelRestrict.prototype.setChannelIdsList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.litrpc.ChannelRestrict.prototype.addChannelIds = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +proto.litrpc.ChannelRestrict.prototype.clearChannelIdsList = function() { + this.setChannelIdsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.litrpc.PeerRestrict = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.litrpc.PeerRestrict.repeatedFields_, null); +}; +goog.inherits(proto.litrpc.PeerRestrict, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.litrpc.PeerRestrict.displayName = 'proto.litrpc.PeerRestrict'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.litrpc.PeerRestrict.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.litrpc.PeerRestrict.prototype.toObject = function(opt_includeInstance) { + return proto.litrpc.PeerRestrict.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.litrpc.PeerRestrict} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.PeerRestrict.toObject = function(includeInstance, msg) { + var f, obj = { + peerIdsList: jspb.Message.getRepeatedField(msg, 1) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.litrpc.PeerRestrict} + */ +proto.litrpc.PeerRestrict.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.litrpc.PeerRestrict; + return proto.litrpc.PeerRestrict.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.litrpc.PeerRestrict} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.litrpc.PeerRestrict} + */ +proto.litrpc.PeerRestrict.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addPeerIds(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.litrpc.PeerRestrict.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.litrpc.PeerRestrict.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.litrpc.PeerRestrict} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.litrpc.PeerRestrict.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPeerIdsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string peer_ids = 1; + * @return {!Array} + */ +proto.litrpc.PeerRestrict.prototype.getPeerIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.litrpc.PeerRestrict.prototype.setPeerIdsList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.litrpc.PeerRestrict.prototype.addPeerIds = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +proto.litrpc.PeerRestrict.prototype.clearPeerIdsList = function() { + this.setPeerIdsList([]); +}; + + /** * @enum {number} */ @@ -2025,6 +4411,7 @@ proto.litrpc.SessionType = { TYPE_MACAROON_ADMIN: 1, TYPE_MACAROON_CUSTOM: 2, TYPE_UI_PASSWORD: 3, + TYPE_AUTOPILOT: 4, TYPE_MACAROON_ACCOUNT: 5 }; diff --git a/app/src/util/tests/sampleData.ts b/app/src/util/tests/sampleData.ts index 7f2f8017..b86761bd 100644 --- a/app/src/util/tests/sampleData.ts +++ b/app/src/util/tests/sampleData.ts @@ -887,6 +887,7 @@ export const poolRegisterSidecar: POOL.SidecarTicket.AsObject = { export const litListSessions: LIT.ListSessionsResponse.AsObject = { sessionsList: [ { + id: '', devServer: true, expiryTimestampSeconds: '253370782800', label: 'Default Session', @@ -899,8 +900,73 @@ export const litListSessions: LIT.ListSessionsResponse.AsObject = { sessionType: LIT.SessionType.TYPE_UI_PASSWORD, createdAt: '253300000000', accountId: '', + autopilotFeatureInfoMap: [ + [ + 'SampleFeature', + { + rulesMap: [ + [ + 'channel-policy-bounds', + { + chanPolicyBounds: { + minBaseMsat: '0', + maxBaseMsat: '10', + minRatePpm: 1, + maxRatePpm: 10, + minCltvDelta: 18, + maxCltvDelta: 18, + minHtlcMsat: '0', + maxHtlcMsat: '0', + }, + }, + ], + [ + 'channel-restriction', + { + channelRestrict: { + channelIdsList: [], + }, + }, + ], + [ + 'history-limit', + { + historyLimit: { + startTime: '0', + duration: '0', + }, + }, + ], + [ + 'peer-restriction', + { + peerRestrict: { + peerIdsList: [], + }, + }, + ], + [ + 'rate-limit', + { + rateLimit: { + readLimit: { + iterations: 50, + numHours: 1, + }, + writeLimit: { + iterations: 50, + numHours: 50, + }, + }, + }, + ], + ], + }, + ], + ], }, { + id: '', devServer: true, expiryTimestampSeconds: '253370782800', label: 'Default Session', @@ -913,6 +979,70 @@ export const litListSessions: LIT.ListSessionsResponse.AsObject = { sessionType: LIT.SessionType.TYPE_UI_PASSWORD, createdAt: '253300000000', accountId: '', + autopilotFeatureInfoMap: [ + [ + 'SampleFeature', + { + rulesMap: [ + [ + 'channel-policy-bounds', + { + chanPolicyBounds: { + minBaseMsat: '0', + maxBaseMsat: '10', + minRatePpm: 1, + maxRatePpm: 10, + minCltvDelta: 18, + maxCltvDelta: 18, + minHtlcMsat: '0', + maxHtlcMsat: '0', + }, + }, + ], + [ + 'channel-restriction', + { + channelRestrict: { + channelIdsList: [], + }, + }, + ], + [ + 'history-limit', + { + historyLimit: { + startTime: '0', + duration: '0', + }, + }, + ], + [ + 'peer-restriction', + { + peerRestrict: { + peerIdsList: [], + }, + }, + ], + [ + 'rate-limit', + { + rateLimit: { + readLimit: { + iterations: 50, + numHours: 1, + }, + writeLimit: { + iterations: 50, + numHours: 50, + }, + }, + }, + ], + ], + }, + ], + ], }, ], }; diff --git a/litclient/jsoncallbacks.go b/litclient/jsoncallbacks.go index 49385d58..e13a823b 100644 --- a/litclient/jsoncallbacks.go +++ b/litclient/jsoncallbacks.go @@ -4,6 +4,7 @@ import ( "context" "github.com/lightninglabs/faraday/frdrpc" + "github.com/lightninglabs/lightning-terminal/litrpc" "github.com/lightninglabs/loop/looprpc" "github.com/lightninglabs/pool/poolrpc" "github.com/lightningnetwork/lnd/lnrpc" @@ -41,4 +42,7 @@ var Registrations = []StubPackageRegistration{ looprpc.RegisterSwapClientJSONCallbacks, poolrpc.RegisterTraderJSONCallbacks, frdrpc.RegisterFaradayServerJSONCallbacks, + litrpc.RegisterSessionsJSONCallbacks, + litrpc.RegisterAccountsJSONCallbacks, + litrpc.RegisterAutopilotJSONCallbacks, } diff --git a/litrpc/Dockerfile b/litrpc/Dockerfile index 4d5ca15d..b4c5112c 100644 --- a/litrpc/Dockerfile +++ b/litrpc/Dockerfile @@ -12,12 +12,14 @@ ARG PROTOBUF_VERSION ARG GRPC_GATEWAY_VERSION ENV PROTOC_GEN_GO_GRPC_VERSION="v1.1.0" +ENV FALAFEL_VERSION="v0.9.1" RUN cd /tmp \ && go get google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION} \ && go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} \ && go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ - && go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} + && go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} \ + && go get github.com/lightninglabs/falafel@${FALAFEL_VERSION} WORKDIR /build diff --git a/litrpc/accounts.pb.json.go b/litrpc/accounts.pb.json.go new file mode 100644 index 00000000..5c8f724e --- /dev/null +++ b/litrpc/accounts.pb.json.go @@ -0,0 +1,123 @@ +// Code generated by falafel 0.9.1. DO NOT EDIT. +// source: lit-accounts.proto + +package litrpc + +import ( + "context" + + gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "google.golang.org/grpc" + "google.golang.org/protobuf/encoding/protojson" +) + +func RegisterAccountsJSONCallbacks(registry map[string]func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error))) { + + marshaler := &gateway.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, + } + + registry["litrpc.Accounts.CreateAccount"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &CreateAccountRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAccountsClient(conn) + resp, err := client.CreateAccount(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Accounts.UpdateAccount"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &UpdateAccountRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAccountsClient(conn) + resp, err := client.UpdateAccount(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Accounts.ListAccounts"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &ListAccountsRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAccountsClient(conn) + resp, err := client.ListAccounts(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Accounts.RemoveAccount"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &RemoveAccountRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAccountsClient(conn) + resp, err := client.RemoveAccount(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } +} diff --git a/litrpc/autopilot.pb.json.go b/litrpc/autopilot.pb.json.go new file mode 100644 index 00000000..76c915f3 --- /dev/null +++ b/litrpc/autopilot.pb.json.go @@ -0,0 +1,123 @@ +// Code generated by falafel 0.9.1. DO NOT EDIT. +// source: lit-autopilot.proto + +package litrpc + +import ( + "context" + + gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "google.golang.org/grpc" + "google.golang.org/protobuf/encoding/protojson" +) + +func RegisterAutopilotJSONCallbacks(registry map[string]func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error))) { + + marshaler := &gateway.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, + } + + registry["litrpc.Autopilot.ListAutopilotFeatures"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &ListAutopilotFeaturesRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAutopilotClient(conn) + resp, err := client.ListAutopilotFeatures(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Autopilot.AddAutopilotSession"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &AddAutopilotSessionRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAutopilotClient(conn) + resp, err := client.AddAutopilotSession(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Autopilot.ListAutopilotSessions"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &ListAutopilotSessionsRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAutopilotClient(conn) + resp, err := client.ListAutopilotSessions(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Autopilot.RevokeAutopilotSession"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &RevokeAutopilotSessionRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewAutopilotClient(conn) + resp, err := client.RevokeAutopilotSession(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } +} diff --git a/litrpc/gen_protos.sh b/litrpc/gen_protos.sh index cc413d8c..d6c6439d 100755 --- a/litrpc/gen_protos.sh +++ b/litrpc/gen_protos.sh @@ -4,12 +4,27 @@ set -e # generate compiles the *.pb.go stubs from the *.proto files. function generate() { - # Generate the gRPC bindings for all proto files. for file in ./*.proto; do - protoc -I/usr/local/include -I. -I.. \ + # Generate the gRPC bindings for all proto files. + protoc -I. -I.. \ --go_out . --go_opt paths=source_relative \ --go-grpc_out . --go-grpc_opt paths=source_relative \ "${file}" + + # Only generate JSON/WASM stubs if requested. + if [[ "$1" == "no-wasm" ]]; then + return + fi + + # Generate the JSON/WASM autopilot stubs. + falafel=$(which falafel) + pkg="litrpc" + opts="package_name=$pkg,js_stubs=1" + protoc -I. -I.. \ + --plugin=protoc-gen-custom=$falafel\ + --custom_out=. \ + --custom_opt="$opts" \ + "${file}" done } diff --git a/litrpc/lit-autopilot.pb.go b/litrpc/lit-autopilot.pb.go new file mode 100644 index 00000000..87aafe9f --- /dev/null +++ b/litrpc/lit-autopilot.pb.go @@ -0,0 +1,1111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.6.1 +// source: lit-autopilot.proto + +package litrpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AddAutopilotSessionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //A human readable label to assign to the session. + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + // + //The unix timestamp at which this session should be revoked. + ExpiryTimestampSeconds uint64 `protobuf:"varint,2,opt,name=expiry_timestamp_seconds,json=expiryTimestampSeconds,proto3" json:"expiry_timestamp_seconds,omitempty"` + // + //The address of the mailbox server to connect to for this session. + MailboxServerAddr string `protobuf:"bytes,3,opt,name=mailbox_server_addr,json=mailboxServerAddr,proto3" json:"mailbox_server_addr,omitempty"` + // + //Set to true if tls should be skipped for when connecting to the mailbox. + DevServer bool `protobuf:"varint,4,opt,name=dev_server,json=devServer,proto3" json:"dev_server,omitempty"` + // + //The features that the session should subscribe to. Each feature maps to + //a FeatureConfig that should be applied to that feature. + Features map[string]*FeatureConfig `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // + //Rules that apply to the entire session. By default, no rules will apply + //to the entire session. + SessionRules *RulesMap `protobuf:"bytes,6,opt,name=session_rules,json=sessionRules,proto3" json:"session_rules,omitempty"` + // + //Set to true of the session should not make use of the privacy mapper. + NoPrivacyMapper bool `protobuf:"varint,7,opt,name=no_privacy_mapper,json=noPrivacyMapper,proto3" json:"no_privacy_mapper,omitempty"` +} + +func (x *AddAutopilotSessionRequest) Reset() { + *x = AddAutopilotSessionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddAutopilotSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddAutopilotSessionRequest) ProtoMessage() {} + +func (x *AddAutopilotSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddAutopilotSessionRequest.ProtoReflect.Descriptor instead. +func (*AddAutopilotSessionRequest) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{0} +} + +func (x *AddAutopilotSessionRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *AddAutopilotSessionRequest) GetExpiryTimestampSeconds() uint64 { + if x != nil { + return x.ExpiryTimestampSeconds + } + return 0 +} + +func (x *AddAutopilotSessionRequest) GetMailboxServerAddr() string { + if x != nil { + return x.MailboxServerAddr + } + return "" +} + +func (x *AddAutopilotSessionRequest) GetDevServer() bool { + if x != nil { + return x.DevServer + } + return false +} + +func (x *AddAutopilotSessionRequest) GetFeatures() map[string]*FeatureConfig { + if x != nil { + return x.Features + } + return nil +} + +func (x *AddAutopilotSessionRequest) GetSessionRules() *RulesMap { + if x != nil { + return x.SessionRules + } + return nil +} + +func (x *AddAutopilotSessionRequest) GetNoPrivacyMapper() bool { + if x != nil { + return x.NoPrivacyMapper + } + return false +} + +type FeatureConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The RulesMap acts as an override map. In other words, by default the rules + //values recommended by the Auto Pilot server will be used but the RulesMap + //can be used to override the defaults. + Rules *RulesMap `protobuf:"bytes,1,opt,name=rules,proto3" json:"rules,omitempty"` + // + //Serialised configuration for the feature. + Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *FeatureConfig) Reset() { + *x = FeatureConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureConfig) ProtoMessage() {} + +func (x *FeatureConfig) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureConfig.ProtoReflect.Descriptor instead. +func (*FeatureConfig) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{1} +} + +func (x *FeatureConfig) GetRules() *RulesMap { + if x != nil { + return x.Rules + } + return nil +} + +func (x *FeatureConfig) GetConfig() []byte { + if x != nil { + return x.Config + } + return nil +} + +type ListAutopilotSessionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListAutopilotSessionsRequest) Reset() { + *x = ListAutopilotSessionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAutopilotSessionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAutopilotSessionsRequest) ProtoMessage() {} + +func (x *ListAutopilotSessionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAutopilotSessionsRequest.ProtoReflect.Descriptor instead. +func (*ListAutopilotSessionsRequest) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{2} +} + +type ListAutopilotSessionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //A list of the Autopilot sessions. + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` +} + +func (x *ListAutopilotSessionsResponse) Reset() { + *x = ListAutopilotSessionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAutopilotSessionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAutopilotSessionsResponse) ProtoMessage() {} + +func (x *ListAutopilotSessionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAutopilotSessionsResponse.ProtoReflect.Descriptor instead. +func (*ListAutopilotSessionsResponse) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{3} +} + +func (x *ListAutopilotSessionsResponse) GetSessions() []*Session { + if x != nil { + return x.Sessions + } + return nil +} + +type AddAutopilotSessionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //Details of the session that was just created. + Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` +} + +func (x *AddAutopilotSessionResponse) Reset() { + *x = AddAutopilotSessionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddAutopilotSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddAutopilotSessionResponse) ProtoMessage() {} + +func (x *AddAutopilotSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddAutopilotSessionResponse.ProtoReflect.Descriptor instead. +func (*AddAutopilotSessionResponse) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{4} +} + +func (x *AddAutopilotSessionResponse) GetSession() *Session { + if x != nil { + return x.Session + } + return nil +} + +type ListAutopilotFeaturesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListAutopilotFeaturesRequest) Reset() { + *x = ListAutopilotFeaturesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAutopilotFeaturesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAutopilotFeaturesRequest) ProtoMessage() {} + +func (x *ListAutopilotFeaturesRequest) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAutopilotFeaturesRequest.ProtoReflect.Descriptor instead. +func (*ListAutopilotFeaturesRequest) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{5} +} + +type ListAutopilotFeaturesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //A map of feature names to Feature objects describing the feature. + Features map[string]*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ListAutopilotFeaturesResponse) Reset() { + *x = ListAutopilotFeaturesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAutopilotFeaturesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAutopilotFeaturesResponse) ProtoMessage() {} + +func (x *ListAutopilotFeaturesResponse) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAutopilotFeaturesResponse.ProtoReflect.Descriptor instead. +func (*ListAutopilotFeaturesResponse) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{6} +} + +func (x *ListAutopilotFeaturesResponse) GetFeatures() map[string]*Feature { + if x != nil { + return x.Features + } + return nil +} + +type RevokeAutopilotSessionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LocalPublicKey []byte `protobuf:"bytes,1,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"` +} + +func (x *RevokeAutopilotSessionRequest) Reset() { + *x = RevokeAutopilotSessionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeAutopilotSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeAutopilotSessionRequest) ProtoMessage() {} + +func (x *RevokeAutopilotSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeAutopilotSessionRequest.ProtoReflect.Descriptor instead. +func (*RevokeAutopilotSessionRequest) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{7} +} + +func (x *RevokeAutopilotSessionRequest) GetLocalPublicKey() []byte { + if x != nil { + return x.LocalPublicKey + } + return nil +} + +type RevokeAutopilotSessionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RevokeAutopilotSessionResponse) Reset() { + *x = RevokeAutopilotSessionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeAutopilotSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeAutopilotSessionResponse) ProtoMessage() {} + +func (x *RevokeAutopilotSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeAutopilotSessionResponse.ProtoReflect.Descriptor instead. +func (*RevokeAutopilotSessionResponse) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{8} +} + +type Feature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //Name is the name of the Autopilot feature. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // + //A human readable description of what the feature offers. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // + //A map of rules that make sense for this feature. Each rule is accompanied + //with appropriate default values for the feature along with minimum and + //maximum values for the rules. + Rules map[string]*RuleValues `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // + //A list of URI permissions required by the feature. + PermissionsList []*Permissions `protobuf:"bytes,4,rep,name=permissions_list,json=permissionsList,proto3" json:"permissions_list,omitempty"` + // + //A boolean indicating if the user would need to upgrade their Litd version in + //order to subscribe to the Autopilot feature. This will be true if the + //feature rules set contains a rule that Litd is unaware of. + RequiresUpgrade bool `protobuf:"varint,5,opt,name=requires_upgrade,json=requiresUpgrade,proto3" json:"requires_upgrade,omitempty"` +} + +func (x *Feature) Reset() { + *x = Feature{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Feature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Feature) ProtoMessage() {} + +func (x *Feature) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Feature.ProtoReflect.Descriptor instead. +func (*Feature) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{9} +} + +func (x *Feature) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Feature) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Feature) GetRules() map[string]*RuleValues { + if x != nil { + return x.Rules + } + return nil +} + +func (x *Feature) GetPermissionsList() []*Permissions { + if x != nil { + return x.PermissionsList + } + return nil +} + +func (x *Feature) GetRequiresUpgrade() bool { + if x != nil { + return x.RequiresUpgrade + } + return false +} + +type RuleValues struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //Whether or not the users version of Litd is aware of this rule. + Known bool `protobuf:"varint,1,opt,name=known,proto3" json:"known,omitempty"` + // + //The default values for the rule that the Autopilot server recommends for + //the associated feature. + Defaults *RuleValue `protobuf:"bytes,2,opt,name=defaults,proto3" json:"defaults,omitempty"` + // + //The minimum sane value for this rule for the associated feature. + MinValue *RuleValue `protobuf:"bytes,3,opt,name=min_value,json=minValue,proto3" json:"min_value,omitempty"` + // + //The maximum sane value for this rule for the associated feature. + MaxValue *RuleValue `protobuf:"bytes,4,opt,name=max_value,json=maxValue,proto3" json:"max_value,omitempty"` +} + +func (x *RuleValues) Reset() { + *x = RuleValues{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuleValues) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleValues) ProtoMessage() {} + +func (x *RuleValues) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleValues.ProtoReflect.Descriptor instead. +func (*RuleValues) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{10} +} + +func (x *RuleValues) GetKnown() bool { + if x != nil { + return x.Known + } + return false +} + +func (x *RuleValues) GetDefaults() *RuleValue { + if x != nil { + return x.Defaults + } + return nil +} + +func (x *RuleValues) GetMinValue() *RuleValue { + if x != nil { + return x.MinValue + } + return nil +} + +func (x *RuleValues) GetMaxValue() *RuleValue { + if x != nil { + return x.MaxValue + } + return nil +} + +type Permissions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The URI in question. + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` + // + //A list of the permissions required for this method. + Operations []*MacaroonPermission `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` +} + +func (x *Permissions) Reset() { + *x = Permissions{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_autopilot_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Permissions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Permissions) ProtoMessage() {} + +func (x *Permissions) ProtoReflect() protoreflect.Message { + mi := &file_lit_autopilot_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Permissions.ProtoReflect.Descriptor instead. +func (*Permissions) Descriptor() ([]byte, []int) { + return file_lit_autopilot_proto_rawDescGZIP(), []int{11} +} + +func (x *Permissions) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Permissions) GetOperations() []*MacaroonPermission { + if x != nil { + return x.Operations + } + return nil +} + +var File_lit_autopilot_proto protoreflect.FileDescriptor + +var file_lit_autopilot_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6c, 0x69, 0x74, 0x2d, 0x61, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x1a, 0x12, 0x6c, + 0x69, 0x74, 0x2d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xc4, 0x03, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, + 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x18, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x16, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x6d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x65, 0x76, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, + 0x64, 0x64, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, + 0x63, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x6f, 0x5f, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6e, 0x6f, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x4d, 0x61, + 0x70, 0x70, 0x65, 0x72, 0x1a, 0x52, 0x0a, 0x0d, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4f, 0x0a, 0x0d, 0x46, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x75, 0x6c, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, + 0x63, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x1e, 0x0a, 0x1c, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4c, 0x0a, 0x1d, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6c, + 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x48, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x41, 0x75, + 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x1e, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, + 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xbe, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, + 0x6c, 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x1a, 0x4c, 0x0a, 0x0d, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x49, 0x0a, 0x1d, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x6f, + 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x20, 0x0a, + 0x1e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xaa, 0x02, 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x10, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x5f, + 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x1a, 0x4c, + 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb1, 0x01, 0x0a, + 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x12, 0x2d, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x2e, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x2e, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x61, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x3a, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x32, 0xa0, 0x03, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, + 0x74, 0x12, 0x64, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, + 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x6c, 0x69, 0x74, + 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, + 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, + 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x41, 0x75, + 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, + 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x75, 0x74, 0x6f, 0x70, + 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x41, + 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x24, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, + 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, + 0x16, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, + 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x75, + 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x2d, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2f, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_lit_autopilot_proto_rawDescOnce sync.Once + file_lit_autopilot_proto_rawDescData = file_lit_autopilot_proto_rawDesc +) + +func file_lit_autopilot_proto_rawDescGZIP() []byte { + file_lit_autopilot_proto_rawDescOnce.Do(func() { + file_lit_autopilot_proto_rawDescData = protoimpl.X.CompressGZIP(file_lit_autopilot_proto_rawDescData) + }) + return file_lit_autopilot_proto_rawDescData +} + +var file_lit_autopilot_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_lit_autopilot_proto_goTypes = []interface{}{ + (*AddAutopilotSessionRequest)(nil), // 0: litrpc.AddAutopilotSessionRequest + (*FeatureConfig)(nil), // 1: litrpc.FeatureConfig + (*ListAutopilotSessionsRequest)(nil), // 2: litrpc.ListAutopilotSessionsRequest + (*ListAutopilotSessionsResponse)(nil), // 3: litrpc.ListAutopilotSessionsResponse + (*AddAutopilotSessionResponse)(nil), // 4: litrpc.AddAutopilotSessionResponse + (*ListAutopilotFeaturesRequest)(nil), // 5: litrpc.ListAutopilotFeaturesRequest + (*ListAutopilotFeaturesResponse)(nil), // 6: litrpc.ListAutopilotFeaturesResponse + (*RevokeAutopilotSessionRequest)(nil), // 7: litrpc.RevokeAutopilotSessionRequest + (*RevokeAutopilotSessionResponse)(nil), // 8: litrpc.RevokeAutopilotSessionResponse + (*Feature)(nil), // 9: litrpc.Feature + (*RuleValues)(nil), // 10: litrpc.RuleValues + (*Permissions)(nil), // 11: litrpc.Permissions + nil, // 12: litrpc.AddAutopilotSessionRequest.FeaturesEntry + nil, // 13: litrpc.ListAutopilotFeaturesResponse.FeaturesEntry + nil, // 14: litrpc.Feature.RulesEntry + (*RulesMap)(nil), // 15: litrpc.RulesMap + (*Session)(nil), // 16: litrpc.Session + (*RuleValue)(nil), // 17: litrpc.RuleValue + (*MacaroonPermission)(nil), // 18: litrpc.MacaroonPermission +} +var file_lit_autopilot_proto_depIdxs = []int32{ + 12, // 0: litrpc.AddAutopilotSessionRequest.features:type_name -> litrpc.AddAutopilotSessionRequest.FeaturesEntry + 15, // 1: litrpc.AddAutopilotSessionRequest.session_rules:type_name -> litrpc.RulesMap + 15, // 2: litrpc.FeatureConfig.rules:type_name -> litrpc.RulesMap + 16, // 3: litrpc.ListAutopilotSessionsResponse.sessions:type_name -> litrpc.Session + 16, // 4: litrpc.AddAutopilotSessionResponse.session:type_name -> litrpc.Session + 13, // 5: litrpc.ListAutopilotFeaturesResponse.features:type_name -> litrpc.ListAutopilotFeaturesResponse.FeaturesEntry + 14, // 6: litrpc.Feature.rules:type_name -> litrpc.Feature.RulesEntry + 11, // 7: litrpc.Feature.permissions_list:type_name -> litrpc.Permissions + 17, // 8: litrpc.RuleValues.defaults:type_name -> litrpc.RuleValue + 17, // 9: litrpc.RuleValues.min_value:type_name -> litrpc.RuleValue + 17, // 10: litrpc.RuleValues.max_value:type_name -> litrpc.RuleValue + 18, // 11: litrpc.Permissions.operations:type_name -> litrpc.MacaroonPermission + 1, // 12: litrpc.AddAutopilotSessionRequest.FeaturesEntry.value:type_name -> litrpc.FeatureConfig + 9, // 13: litrpc.ListAutopilotFeaturesResponse.FeaturesEntry.value:type_name -> litrpc.Feature + 10, // 14: litrpc.Feature.RulesEntry.value:type_name -> litrpc.RuleValues + 5, // 15: litrpc.Autopilot.ListAutopilotFeatures:input_type -> litrpc.ListAutopilotFeaturesRequest + 0, // 16: litrpc.Autopilot.AddAutopilotSession:input_type -> litrpc.AddAutopilotSessionRequest + 2, // 17: litrpc.Autopilot.ListAutopilotSessions:input_type -> litrpc.ListAutopilotSessionsRequest + 7, // 18: litrpc.Autopilot.RevokeAutopilotSession:input_type -> litrpc.RevokeAutopilotSessionRequest + 6, // 19: litrpc.Autopilot.ListAutopilotFeatures:output_type -> litrpc.ListAutopilotFeaturesResponse + 4, // 20: litrpc.Autopilot.AddAutopilotSession:output_type -> litrpc.AddAutopilotSessionResponse + 3, // 21: litrpc.Autopilot.ListAutopilotSessions:output_type -> litrpc.ListAutopilotSessionsResponse + 8, // 22: litrpc.Autopilot.RevokeAutopilotSession:output_type -> litrpc.RevokeAutopilotSessionResponse + 19, // [19:23] is the sub-list for method output_type + 15, // [15:19] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_lit_autopilot_proto_init() } +func file_lit_autopilot_proto_init() { + if File_lit_autopilot_proto != nil { + return + } + file_lit_sessions_proto_init() + if !protoimpl.UnsafeEnabled { + file_lit_autopilot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddAutopilotSessionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeatureConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAutopilotSessionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAutopilotSessionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddAutopilotSessionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAutopilotFeaturesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAutopilotFeaturesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeAutopilotSessionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeAutopilotSessionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Feature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuleValues); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_autopilot_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Permissions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_lit_autopilot_proto_rawDesc, + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_lit_autopilot_proto_goTypes, + DependencyIndexes: file_lit_autopilot_proto_depIdxs, + MessageInfos: file_lit_autopilot_proto_msgTypes, + }.Build() + File_lit_autopilot_proto = out.File + file_lit_autopilot_proto_rawDesc = nil + file_lit_autopilot_proto_goTypes = nil + file_lit_autopilot_proto_depIdxs = nil +} diff --git a/litrpc/lit-autopilot.proto b/litrpc/lit-autopilot.proto new file mode 100644 index 00000000..740829d5 --- /dev/null +++ b/litrpc/lit-autopilot.proto @@ -0,0 +1,174 @@ +syntax = "proto3"; + +import "lit-sessions.proto"; + +package litrpc; + +option go_package = "github.com/lightninglabs/lightning-terminal/litrpc"; + +service Autopilot { + rpc ListAutopilotFeatures (ListAutopilotFeaturesRequest) + returns (ListAutopilotFeaturesResponse); + + rpc AddAutopilotSession (AddAutopilotSessionRequest) + returns (AddAutopilotSessionResponse); + + rpc ListAutopilotSessions (ListAutopilotSessionsRequest) + returns (ListAutopilotSessionsResponse); + + rpc RevokeAutopilotSession (RevokeAutopilotSessionRequest) + returns (RevokeAutopilotSessionResponse); +} + +message AddAutopilotSessionRequest { + /* + A human readable label to assign to the session. + */ + string label = 1; + + /* + The unix timestamp at which this session should be revoked. + */ + uint64 expiry_timestamp_seconds = 2 [jstype = JS_STRING]; + + /* + The address of the mailbox server to connect to for this session. + */ + string mailbox_server_addr = 3; + + /* + Set to true if tls should be skipped for when connecting to the mailbox. + */ + bool dev_server = 4; + + /* + The features that the session should subscribe to. Each feature maps to + a FeatureConfig that should be applied to that feature. + */ + map features = 5; + + /* + Rules that apply to the entire session. By default, no rules will apply + to the entire session. + */ + RulesMap session_rules = 6; + + /* + Set to true of the session should not make use of the privacy mapper. + */ + bool no_privacy_mapper = 7; +} + +message FeatureConfig { + /* + The RulesMap acts as an override map. In other words, by default the rules + values recommended by the Auto Pilot server will be used but the RulesMap + can be used to override the defaults. + */ + RulesMap rules = 1; + + /* + Serialised configuration for the feature. + */ + bytes config = 2; +} + +message ListAutopilotSessionsRequest { +} + +message ListAutopilotSessionsResponse { + /* + A list of the Autopilot sessions. + */ + repeated Session sessions = 1; +} + +message AddAutopilotSessionResponse { + /* + Details of the session that was just created. + */ + Session session = 1; +} + +message ListAutopilotFeaturesRequest { +} + +message ListAutopilotFeaturesResponse { + /* + A map of feature names to Feature objects describing the feature. + */ + map features = 1; +} + +message RevokeAutopilotSessionRequest { + bytes local_public_key = 1; +} + +message RevokeAutopilotSessionResponse { +} + +message Feature { + /* + Name is the name of the Autopilot feature. + */ + string name = 1; + + /* + A human readable description of what the feature offers. + */ + string description = 2; + + /* + A map of rules that make sense for this feature. Each rule is accompanied + with appropriate default values for the feature along with minimum and + maximum values for the rules. + */ + map rules = 3; + + /* + A list of URI permissions required by the feature. + */ + repeated Permissions permissions_list = 4; + + /* + A boolean indicating if the user would need to upgrade their Litd version in + order to subscribe to the Autopilot feature. This will be true if the + feature rules set contains a rule that Litd is unaware of. + */ + bool requires_upgrade = 5; +} + +message RuleValues { + /* + Whether or not the users version of Litd is aware of this rule. + */ + bool known = 1; + + /* + The default values for the rule that the Autopilot server recommends for + the associated feature. + */ + RuleValue defaults = 2; + + /* + The minimum sane value for this rule for the associated feature. + */ + RuleValue min_value = 3; + + /* + The maximum sane value for this rule for the associated feature. + */ + RuleValue max_value = 4; +} + +message Permissions { + /* + The URI in question. + */ + string method = 1; + + /* + A list of the permissions required for this method. + */ + repeated MacaroonPermission operations = 2; +} \ No newline at end of file diff --git a/litrpc/lit-autopilot_grpc.pb.go b/litrpc/lit-autopilot_grpc.pb.go new file mode 100644 index 00000000..04e53f68 --- /dev/null +++ b/litrpc/lit-autopilot_grpc.pb.go @@ -0,0 +1,209 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package litrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AutopilotClient is the client API for Autopilot service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AutopilotClient interface { + ListAutopilotFeatures(ctx context.Context, in *ListAutopilotFeaturesRequest, opts ...grpc.CallOption) (*ListAutopilotFeaturesResponse, error) + AddAutopilotSession(ctx context.Context, in *AddAutopilotSessionRequest, opts ...grpc.CallOption) (*AddAutopilotSessionResponse, error) + ListAutopilotSessions(ctx context.Context, in *ListAutopilotSessionsRequest, opts ...grpc.CallOption) (*ListAutopilotSessionsResponse, error) + RevokeAutopilotSession(ctx context.Context, in *RevokeAutopilotSessionRequest, opts ...grpc.CallOption) (*RevokeAutopilotSessionResponse, error) +} + +type autopilotClient struct { + cc grpc.ClientConnInterface +} + +func NewAutopilotClient(cc grpc.ClientConnInterface) AutopilotClient { + return &autopilotClient{cc} +} + +func (c *autopilotClient) ListAutopilotFeatures(ctx context.Context, in *ListAutopilotFeaturesRequest, opts ...grpc.CallOption) (*ListAutopilotFeaturesResponse, error) { + out := new(ListAutopilotFeaturesResponse) + err := c.cc.Invoke(ctx, "/litrpc.Autopilot/ListAutopilotFeatures", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) AddAutopilotSession(ctx context.Context, in *AddAutopilotSessionRequest, opts ...grpc.CallOption) (*AddAutopilotSessionResponse, error) { + out := new(AddAutopilotSessionResponse) + err := c.cc.Invoke(ctx, "/litrpc.Autopilot/AddAutopilotSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) ListAutopilotSessions(ctx context.Context, in *ListAutopilotSessionsRequest, opts ...grpc.CallOption) (*ListAutopilotSessionsResponse, error) { + out := new(ListAutopilotSessionsResponse) + err := c.cc.Invoke(ctx, "/litrpc.Autopilot/ListAutopilotSessions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autopilotClient) RevokeAutopilotSession(ctx context.Context, in *RevokeAutopilotSessionRequest, opts ...grpc.CallOption) (*RevokeAutopilotSessionResponse, error) { + out := new(RevokeAutopilotSessionResponse) + err := c.cc.Invoke(ctx, "/litrpc.Autopilot/RevokeAutopilotSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AutopilotServer is the server API for Autopilot service. +// All implementations must embed UnimplementedAutopilotServer +// for forward compatibility +type AutopilotServer interface { + ListAutopilotFeatures(context.Context, *ListAutopilotFeaturesRequest) (*ListAutopilotFeaturesResponse, error) + AddAutopilotSession(context.Context, *AddAutopilotSessionRequest) (*AddAutopilotSessionResponse, error) + ListAutopilotSessions(context.Context, *ListAutopilotSessionsRequest) (*ListAutopilotSessionsResponse, error) + RevokeAutopilotSession(context.Context, *RevokeAutopilotSessionRequest) (*RevokeAutopilotSessionResponse, error) + mustEmbedUnimplementedAutopilotServer() +} + +// UnimplementedAutopilotServer must be embedded to have forward compatible implementations. +type UnimplementedAutopilotServer struct { +} + +func (UnimplementedAutopilotServer) ListAutopilotFeatures(context.Context, *ListAutopilotFeaturesRequest) (*ListAutopilotFeaturesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAutopilotFeatures not implemented") +} +func (UnimplementedAutopilotServer) AddAutopilotSession(context.Context, *AddAutopilotSessionRequest) (*AddAutopilotSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddAutopilotSession not implemented") +} +func (UnimplementedAutopilotServer) ListAutopilotSessions(context.Context, *ListAutopilotSessionsRequest) (*ListAutopilotSessionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAutopilotSessions not implemented") +} +func (UnimplementedAutopilotServer) RevokeAutopilotSession(context.Context, *RevokeAutopilotSessionRequest) (*RevokeAutopilotSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeAutopilotSession not implemented") +} +func (UnimplementedAutopilotServer) mustEmbedUnimplementedAutopilotServer() {} + +// UnsafeAutopilotServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AutopilotServer will +// result in compilation errors. +type UnsafeAutopilotServer interface { + mustEmbedUnimplementedAutopilotServer() +} + +func RegisterAutopilotServer(s grpc.ServiceRegistrar, srv AutopilotServer) { + s.RegisterService(&Autopilot_ServiceDesc, srv) +} + +func _Autopilot_ListAutopilotFeatures_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAutopilotFeaturesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).ListAutopilotFeatures(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/litrpc.Autopilot/ListAutopilotFeatures", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).ListAutopilotFeatures(ctx, req.(*ListAutopilotFeaturesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_AddAutopilotSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddAutopilotSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).AddAutopilotSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/litrpc.Autopilot/AddAutopilotSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).AddAutopilotSession(ctx, req.(*AddAutopilotSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_ListAutopilotSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAutopilotSessionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).ListAutopilotSessions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/litrpc.Autopilot/ListAutopilotSessions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).ListAutopilotSessions(ctx, req.(*ListAutopilotSessionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autopilot_RevokeAutopilotSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RevokeAutopilotSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutopilotServer).RevokeAutopilotSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/litrpc.Autopilot/RevokeAutopilotSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutopilotServer).RevokeAutopilotSession(ctx, req.(*RevokeAutopilotSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Autopilot_ServiceDesc is the grpc.ServiceDesc for Autopilot service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Autopilot_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "litrpc.Autopilot", + HandlerType: (*AutopilotServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAutopilotFeatures", + Handler: _Autopilot_ListAutopilotFeatures_Handler, + }, + { + MethodName: "AddAutopilotSession", + Handler: _Autopilot_AddAutopilotSession_Handler, + }, + { + MethodName: "ListAutopilotSessions", + Handler: _Autopilot_ListAutopilotSessions_Handler, + }, + { + MethodName: "RevokeAutopilotSession", + Handler: _Autopilot_RevokeAutopilotSession_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "lit-autopilot.proto", +} diff --git a/litrpc/lit-sessions.pb.go b/litrpc/lit-sessions.pb.go index 907070f6..57edd4b2 100644 --- a/litrpc/lit-sessions.pb.go +++ b/litrpc/lit-sessions.pb.go @@ -27,6 +27,7 @@ const ( SessionType_TYPE_MACAROON_ADMIN SessionType = 1 SessionType_TYPE_MACAROON_CUSTOM SessionType = 2 SessionType_TYPE_UI_PASSWORD SessionType = 3 + SessionType_TYPE_AUTOPILOT SessionType = 4 SessionType_TYPE_MACAROON_ACCOUNT SessionType = 5 ) @@ -37,6 +38,7 @@ var ( 1: "TYPE_MACAROON_ADMIN", 2: "TYPE_MACAROON_CUSTOM", 3: "TYPE_UI_PASSWORD", + 4: "TYPE_AUTOPILOT", 5: "TYPE_MACAROON_ACCOUNT", } SessionType_value = map[string]int32{ @@ -44,6 +46,7 @@ var ( "TYPE_MACAROON_ADMIN": 1, "TYPE_MACAROON_CUSTOM": 2, "TYPE_UI_PASSWORD": 3, + "TYPE_AUTOPILOT": 4, "TYPE_MACAROON_ACCOUNT": 5, } ) @@ -339,20 +342,21 @@ type Session struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id []byte `protobuf:"bytes,14,opt,name=id,proto3" json:"id,omitempty"` - Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` - SessionState SessionState `protobuf:"varint,2,opt,name=session_state,json=sessionState,proto3,enum=litrpc.SessionState" json:"session_state,omitempty"` - SessionType SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=litrpc.SessionType" json:"session_type,omitempty"` - ExpiryTimestampSeconds uint64 `protobuf:"varint,4,opt,name=expiry_timestamp_seconds,json=expiryTimestampSeconds,proto3" json:"expiry_timestamp_seconds,omitempty"` - MailboxServerAddr string `protobuf:"bytes,5,opt,name=mailbox_server_addr,json=mailboxServerAddr,proto3" json:"mailbox_server_addr,omitempty"` - DevServer bool `protobuf:"varint,6,opt,name=dev_server,json=devServer,proto3" json:"dev_server,omitempty"` - PairingSecret []byte `protobuf:"bytes,7,opt,name=pairing_secret,json=pairingSecret,proto3" json:"pairing_secret,omitempty"` - PairingSecretMnemonic string `protobuf:"bytes,8,opt,name=pairing_secret_mnemonic,json=pairingSecretMnemonic,proto3" json:"pairing_secret_mnemonic,omitempty"` - LocalPublicKey []byte `protobuf:"bytes,9,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"` - RemotePublicKey []byte `protobuf:"bytes,10,opt,name=remote_public_key,json=remotePublicKey,proto3" json:"remote_public_key,omitempty"` - CreatedAt uint64 `protobuf:"varint,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - MacaroonRecipe *MacaroonRecipe `protobuf:"bytes,12,opt,name=macaroon_recipe,json=macaroonRecipe,proto3" json:"macaroon_recipe,omitempty"` - AccountId string `protobuf:"bytes,13,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Id []byte `protobuf:"bytes,14,opt,name=id,proto3" json:"id,omitempty"` + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + SessionState SessionState `protobuf:"varint,2,opt,name=session_state,json=sessionState,proto3,enum=litrpc.SessionState" json:"session_state,omitempty"` + SessionType SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=litrpc.SessionType" json:"session_type,omitempty"` + ExpiryTimestampSeconds uint64 `protobuf:"varint,4,opt,name=expiry_timestamp_seconds,json=expiryTimestampSeconds,proto3" json:"expiry_timestamp_seconds,omitempty"` + MailboxServerAddr string `protobuf:"bytes,5,opt,name=mailbox_server_addr,json=mailboxServerAddr,proto3" json:"mailbox_server_addr,omitempty"` + DevServer bool `protobuf:"varint,6,opt,name=dev_server,json=devServer,proto3" json:"dev_server,omitempty"` + PairingSecret []byte `protobuf:"bytes,7,opt,name=pairing_secret,json=pairingSecret,proto3" json:"pairing_secret,omitempty"` + PairingSecretMnemonic string `protobuf:"bytes,8,opt,name=pairing_secret_mnemonic,json=pairingSecretMnemonic,proto3" json:"pairing_secret_mnemonic,omitempty"` + LocalPublicKey []byte `protobuf:"bytes,9,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"` + RemotePublicKey []byte `protobuf:"bytes,10,opt,name=remote_public_key,json=remotePublicKey,proto3" json:"remote_public_key,omitempty"` + CreatedAt uint64 `protobuf:"varint,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + MacaroonRecipe *MacaroonRecipe `protobuf:"bytes,12,opt,name=macaroon_recipe,json=macaroonRecipe,proto3" json:"macaroon_recipe,omitempty"` + AccountId string `protobuf:"bytes,13,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AutopilotFeatureInfo map[string]*RulesMap `protobuf:"bytes,15,rep,name=autopilot_feature_info,json=autopilotFeatureInfo,proto3" json:"autopilot_feature_info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // //The unix timestamp indicating the time at which the session was revoked. //Note that this field has not been around since the beginning and so it @@ -493,6 +497,13 @@ func (x *Session) GetAccountId() string { return "" } +func (x *Session) GetAutopilotFeatureInfo() map[string]*RulesMap { + if x != nil { + return x.AutopilotFeatureInfo + } + return nil +} + func (x *Session) GetRevokedAt() uint64 { if x != nil { return x.RevokedAt @@ -725,6 +736,760 @@ func (*RevokeSessionResponse) Descriptor() ([]byte, []int) { return file_lit_sessions_proto_rawDescGZIP(), []int{8} } +type RulesMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //A map of rule name to RuleValue. The RuleValue should be parsed based on + //the name of the rule. + Rules map[string]*RuleValue `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RulesMap) Reset() { + *x = RulesMap{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RulesMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RulesMap) ProtoMessage() {} + +func (x *RulesMap) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RulesMap.ProtoReflect.Descriptor instead. +func (*RulesMap) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{9} +} + +func (x *RulesMap) GetRules() map[string]*RuleValue { + if x != nil { + return x.Rules + } + return nil +} + +type RuleValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // *RuleValue_RateLimit + // *RuleValue_ChanPolicyBounds + // *RuleValue_HistoryLimit + // *RuleValue_OffChainBudget + // *RuleValue_OnChainBudget + // *RuleValue_SendToSelf + // *RuleValue_ChannelRestrict + // *RuleValue_PeerRestrict + Value isRuleValue_Value `protobuf_oneof:"value"` +} + +func (x *RuleValue) Reset() { + *x = RuleValue{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuleValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleValue) ProtoMessage() {} + +func (x *RuleValue) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleValue.ProtoReflect.Descriptor instead. +func (*RuleValue) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{10} +} + +func (m *RuleValue) GetValue() isRuleValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *RuleValue) GetRateLimit() *RateLimit { + if x, ok := x.GetValue().(*RuleValue_RateLimit); ok { + return x.RateLimit + } + return nil +} + +func (x *RuleValue) GetChanPolicyBounds() *ChannelPolicyBounds { + if x, ok := x.GetValue().(*RuleValue_ChanPolicyBounds); ok { + return x.ChanPolicyBounds + } + return nil +} + +func (x *RuleValue) GetHistoryLimit() *HistoryLimit { + if x, ok := x.GetValue().(*RuleValue_HistoryLimit); ok { + return x.HistoryLimit + } + return nil +} + +func (x *RuleValue) GetOffChainBudget() *OffChainBudget { + if x, ok := x.GetValue().(*RuleValue_OffChainBudget); ok { + return x.OffChainBudget + } + return nil +} + +func (x *RuleValue) GetOnChainBudget() *OnChainBudget { + if x, ok := x.GetValue().(*RuleValue_OnChainBudget); ok { + return x.OnChainBudget + } + return nil +} + +func (x *RuleValue) GetSendToSelf() *SendToSelf { + if x, ok := x.GetValue().(*RuleValue_SendToSelf); ok { + return x.SendToSelf + } + return nil +} + +func (x *RuleValue) GetChannelRestrict() *ChannelRestrict { + if x, ok := x.GetValue().(*RuleValue_ChannelRestrict); ok { + return x.ChannelRestrict + } + return nil +} + +func (x *RuleValue) GetPeerRestrict() *PeerRestrict { + if x, ok := x.GetValue().(*RuleValue_PeerRestrict); ok { + return x.PeerRestrict + } + return nil +} + +type isRuleValue_Value interface { + isRuleValue_Value() +} + +type RuleValue_RateLimit struct { + RateLimit *RateLimit `protobuf:"bytes,1,opt,name=rate_limit,json=rateLimit,proto3,oneof"` +} + +type RuleValue_ChanPolicyBounds struct { + ChanPolicyBounds *ChannelPolicyBounds `protobuf:"bytes,2,opt,name=chan_policy_bounds,json=chanPolicyBounds,proto3,oneof"` +} + +type RuleValue_HistoryLimit struct { + HistoryLimit *HistoryLimit `protobuf:"bytes,3,opt,name=history_limit,json=historyLimit,proto3,oneof"` +} + +type RuleValue_OffChainBudget struct { + OffChainBudget *OffChainBudget `protobuf:"bytes,4,opt,name=off_chain_budget,json=offChainBudget,proto3,oneof"` +} + +type RuleValue_OnChainBudget struct { + OnChainBudget *OnChainBudget `protobuf:"bytes,5,opt,name=on_chain_budget,json=onChainBudget,proto3,oneof"` +} + +type RuleValue_SendToSelf struct { + SendToSelf *SendToSelf `protobuf:"bytes,6,opt,name=send_to_self,json=sendToSelf,proto3,oneof"` +} + +type RuleValue_ChannelRestrict struct { + ChannelRestrict *ChannelRestrict `protobuf:"bytes,7,opt,name=channel_restrict,json=channelRestrict,proto3,oneof"` +} + +type RuleValue_PeerRestrict struct { + PeerRestrict *PeerRestrict `protobuf:"bytes,8,opt,name=peer_restrict,json=peerRestrict,proto3,oneof"` +} + +func (*RuleValue_RateLimit) isRuleValue_Value() {} + +func (*RuleValue_ChanPolicyBounds) isRuleValue_Value() {} + +func (*RuleValue_HistoryLimit) isRuleValue_Value() {} + +func (*RuleValue_OffChainBudget) isRuleValue_Value() {} + +func (*RuleValue_OnChainBudget) isRuleValue_Value() {} + +func (*RuleValue_SendToSelf) isRuleValue_Value() {} + +func (*RuleValue_ChannelRestrict) isRuleValue_Value() {} + +func (*RuleValue_PeerRestrict) isRuleValue_Value() {} + +type RateLimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The rate limit for read-only calls. + ReadLimit *Rate `protobuf:"bytes,1,opt,name=read_limit,json=readLimit,proto3" json:"read_limit,omitempty"` + // + //The rate limit for write/execution calls. + WriteLimit *Rate `protobuf:"bytes,2,opt,name=write_limit,json=writeLimit,proto3" json:"write_limit,omitempty"` +} + +func (x *RateLimit) Reset() { + *x = RateLimit{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimit) ProtoMessage() {} + +func (x *RateLimit) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RateLimit.ProtoReflect.Descriptor instead. +func (*RateLimit) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{11} +} + +func (x *RateLimit) GetReadLimit() *Rate { + if x != nil { + return x.ReadLimit + } + return nil +} + +func (x *RateLimit) GetWriteLimit() *Rate { + if x != nil { + return x.WriteLimit + } + return nil +} + +type Rate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The number of times a call is allowed in num_hours number of hours. + Iterations uint32 `protobuf:"varint,1,opt,name=iterations,proto3" json:"iterations,omitempty"` + // + //The number of hours in which the iterations count takes place over. + NumHours uint32 `protobuf:"varint,2,opt,name=num_hours,json=numHours,proto3" json:"num_hours,omitempty"` +} + +func (x *Rate) Reset() { + *x = Rate{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rate) ProtoMessage() {} + +func (x *Rate) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rate.ProtoReflect.Descriptor instead. +func (*Rate) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{12} +} + +func (x *Rate) GetIterations() uint32 { + if x != nil { + return x.Iterations + } + return 0 +} + +func (x *Rate) GetNumHours() uint32 { + if x != nil { + return x.NumHours + } + return 0 +} + +type HistoryLimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The absolute unix timestamp in seconds before which no information should + //be shared. This should only be set if duration is not set. + StartTime uint64 `protobuf:"varint,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // + //The maximum relative duration in seconds that a request is allowed to query + //for. This should only be set if start_time is not set. + Duration uint64 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` +} + +func (x *HistoryLimit) Reset() { + *x = HistoryLimit{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistoryLimit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryLimit) ProtoMessage() {} + +func (x *HistoryLimit) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryLimit.ProtoReflect.Descriptor instead. +func (*HistoryLimit) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{13} +} + +func (x *HistoryLimit) GetStartTime() uint64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *HistoryLimit) GetDuration() uint64 { + if x != nil { + return x.Duration + } + return 0 +} + +type ChannelPolicyBounds struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The minimum base fee in msat that the autopilot can set for a channel. + MinBaseMsat uint64 `protobuf:"varint,1,opt,name=min_base_msat,json=minBaseMsat,proto3" json:"min_base_msat,omitempty"` + // + //The maximum base fee in msat that the autopilot can set for a channel. + MaxBaseMsat uint64 `protobuf:"varint,2,opt,name=max_base_msat,json=maxBaseMsat,proto3" json:"max_base_msat,omitempty"` + // + //The minimum ppm fee in msat that the autopilot can set for a channel. + MinRatePpm uint32 `protobuf:"varint,3,opt,name=min_rate_ppm,json=minRatePpm,proto3" json:"min_rate_ppm,omitempty"` + // + //The maximum ppm fee in msat that the autopilot can set for a channel. + MaxRatePpm uint32 `protobuf:"varint,4,opt,name=max_rate_ppm,json=maxRatePpm,proto3" json:"max_rate_ppm,omitempty"` + // + //The minimum cltv delta that the autopilot may set for a channel. + MinCltvDelta uint32 `protobuf:"varint,5,opt,name=min_cltv_delta,json=minCltvDelta,proto3" json:"min_cltv_delta,omitempty"` + // + //The maximum cltv delta that the autopilot may set for a channel. + MaxCltvDelta uint32 `protobuf:"varint,6,opt,name=max_cltv_delta,json=maxCltvDelta,proto3" json:"max_cltv_delta,omitempty"` + // + //The minimum htlc msat that the autopilot may set for a channel. + MinHtlcMsat uint64 `protobuf:"varint,7,opt,name=min_htlc_msat,json=minHtlcMsat,proto3" json:"min_htlc_msat,omitempty"` + // + //The maximum htlc msat that the autopilot may set for a channel. + MaxHtlcMsat uint64 `protobuf:"varint,8,opt,name=max_htlc_msat,json=maxHtlcMsat,proto3" json:"max_htlc_msat,omitempty"` +} + +func (x *ChannelPolicyBounds) Reset() { + *x = ChannelPolicyBounds{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelPolicyBounds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelPolicyBounds) ProtoMessage() {} + +func (x *ChannelPolicyBounds) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelPolicyBounds.ProtoReflect.Descriptor instead. +func (*ChannelPolicyBounds) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{14} +} + +func (x *ChannelPolicyBounds) GetMinBaseMsat() uint64 { + if x != nil { + return x.MinBaseMsat + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMaxBaseMsat() uint64 { + if x != nil { + return x.MaxBaseMsat + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMinRatePpm() uint32 { + if x != nil { + return x.MinRatePpm + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMaxRatePpm() uint32 { + if x != nil { + return x.MaxRatePpm + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMinCltvDelta() uint32 { + if x != nil { + return x.MinCltvDelta + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMaxCltvDelta() uint32 { + if x != nil { + return x.MaxCltvDelta + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMinHtlcMsat() uint64 { + if x != nil { + return x.MinHtlcMsat + } + return 0 +} + +func (x *ChannelPolicyBounds) GetMaxHtlcMsat() uint64 { + if x != nil { + return x.MaxHtlcMsat + } + return 0 +} + +type OffChainBudget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxAmtMsat uint64 `protobuf:"varint,1,opt,name=max_amt_msat,json=maxAmtMsat,proto3" json:"max_amt_msat,omitempty"` + MaxFeesMsat uint64 `protobuf:"varint,2,opt,name=max_fees_msat,json=maxFeesMsat,proto3" json:"max_fees_msat,omitempty"` +} + +func (x *OffChainBudget) Reset() { + *x = OffChainBudget{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OffChainBudget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OffChainBudget) ProtoMessage() {} + +func (x *OffChainBudget) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OffChainBudget.ProtoReflect.Descriptor instead. +func (*OffChainBudget) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{15} +} + +func (x *OffChainBudget) GetMaxAmtMsat() uint64 { + if x != nil { + return x.MaxAmtMsat + } + return 0 +} + +func (x *OffChainBudget) GetMaxFeesMsat() uint64 { + if x != nil { + return x.MaxFeesMsat + } + return 0 +} + +type OnChainBudget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AbsoluteAmtSats uint64 `protobuf:"varint,1,opt,name=absolute_amt_sats,json=absoluteAmtSats,proto3" json:"absolute_amt_sats,omitempty"` + MaxSatPerVByte uint64 `protobuf:"varint,2,opt,name=max_sat_per_v_byte,json=maxSatPerVByte,proto3" json:"max_sat_per_v_byte,omitempty"` +} + +func (x *OnChainBudget) Reset() { + *x = OnChainBudget{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OnChainBudget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnChainBudget) ProtoMessage() {} + +func (x *OnChainBudget) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnChainBudget.ProtoReflect.Descriptor instead. +func (*OnChainBudget) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{16} +} + +func (x *OnChainBudget) GetAbsoluteAmtSats() uint64 { + if x != nil { + return x.AbsoluteAmtSats + } + return 0 +} + +func (x *OnChainBudget) GetMaxSatPerVByte() uint64 { + if x != nil { + return x.MaxSatPerVByte + } + return 0 +} + +type SendToSelf struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SendToSelf) Reset() { + *x = SendToSelf{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendToSelf) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendToSelf) ProtoMessage() {} + +func (x *SendToSelf) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendToSelf.ProtoReflect.Descriptor instead. +func (*SendToSelf) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{17} +} + +type ChannelRestrict struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelIds []uint64 `protobuf:"varint,1,rep,packed,name=channel_ids,json=channelIds,proto3" json:"channel_ids,omitempty"` +} + +func (x *ChannelRestrict) Reset() { + *x = ChannelRestrict{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelRestrict) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelRestrict) ProtoMessage() {} + +func (x *ChannelRestrict) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelRestrict.ProtoReflect.Descriptor instead. +func (*ChannelRestrict) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{18} +} + +func (x *ChannelRestrict) GetChannelIds() []uint64 { + if x != nil { + return x.ChannelIds + } + return nil +} + +type PeerRestrict struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerIds []string `protobuf:"bytes,1,rep,name=peer_ids,json=peerIds,proto3" json:"peer_ids,omitempty"` +} + +func (x *PeerRestrict) Reset() { + *x = PeerRestrict{} + if protoimpl.UnsafeEnabled { + mi := &file_lit_sessions_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerRestrict) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerRestrict) ProtoMessage() {} + +func (x *PeerRestrict) ProtoReflect() protoreflect.Message { + mi := &file_lit_sessions_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerRestrict.ProtoReflect.Descriptor instead. +func (*PeerRestrict) Descriptor() ([]byte, []int) { + return file_lit_sessions_proto_rawDescGZIP(), []int{19} +} + +func (x *PeerRestrict) GetPeerIds() []string { + if x != nil { + return x.PeerIds + } + return nil +} + var File_lit_sessions_proto protoreflect.FileDescriptor var file_lit_sessions_proto_rawDesc = []byte{ @@ -761,7 +1526,7 @@ var file_lit_sessions_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x90, 0x05, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0xc6, 0x06, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x39, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, @@ -799,61 +1564,172 @@ var file_lit_sessions_proto_rawDesc = []byte{ 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x65, 0x52, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0a, 0x72, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, - 0x01, 0x52, 0x09, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x4a, 0x04, 0x08, 0x0f, - 0x10, 0x10, 0x22, 0x68, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, - 0x63, 0x69, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x74, 0x72, - 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x22, 0x15, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x14, 0x52, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2a, 0x93, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x41, - 0x52, 0x4f, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x00, 0x12, - 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, - 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, - 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x5f, 0x50, 0x41, - 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, - 0x54, 0x10, 0x05, 0x22, 0x04, 0x08, 0x04, 0x10, 0x04, 0x2a, 0x59, 0x0a, 0x0c, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, - 0x54, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x10, 0x01, 0x12, 0x11, - 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x56, 0x4f, 0x4b, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, - 0x45, 0x44, 0x10, 0x03, 0x32, 0xe8, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x43, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x69, 0x74, - 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x5f, 0x0a, 0x16, 0x61, 0x75, 0x74, + 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6c, 0x69, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x70, + 0x69, 0x6c, 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x14, 0x61, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0a, 0x72, 0x65, + 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, + 0x30, 0x01, 0x52, 0x09, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x59, 0x0a, + 0x19, 0x41, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x68, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x61, + 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x69, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, + 0x6e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x76, 0x65, + 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, + 0x74, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, - 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x69, 0x67, 0x68, - 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x2d, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2f, 0x6c, - 0x69, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, + 0x0a, 0x14, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x08, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x31, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, + 0x75, 0x6c, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x4b, 0x0a, 0x0a, 0x52, 0x75, 0x6c, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, + 0x63, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, 0x04, 0x0a, 0x09, 0x52, 0x75, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, + 0x63, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x09, 0x72, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4b, 0x0a, 0x12, 0x63, 0x68, 0x61, 0x6e, + 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x48, 0x00, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0d, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, + 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x42, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, + 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x66, 0x66, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x42, 0x75, + 0x64, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x6f, 0x66, 0x66, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x0f, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, + 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6c, + 0x66, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6c, 0x66, 0x12, + 0x44, 0x0a, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, + 0x69, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6c, 0x69, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x12, 0x3b, 0x0a, 0x0d, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x72, 0x65, + 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, + 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x67, 0x0a, 0x09, 0x52, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, + 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2d, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x69, 0x74, + 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x22, 0x43, 0x0a, 0x04, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x75, 0x6d, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x6e, 0x75, 0x6d, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x22, 0x51, 0x0a, 0x0c, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, + 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x08, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, + 0x30, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc5, 0x02, 0x0a, + 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0d, 0x6d, 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, 0x65, + 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x0b, 0x6d, 0x69, 0x6e, 0x42, 0x61, 0x73, 0x65, 0x4d, 0x73, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0d, + 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x73, 0x65, + 0x4d, 0x73, 0x61, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x5f, 0x70, 0x70, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x52, + 0x61, 0x74, 0x65, 0x50, 0x70, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x5f, 0x70, 0x70, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, + 0x78, 0x52, 0x61, 0x74, 0x65, 0x50, 0x70, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, + 0x63, 0x6c, 0x74, 0x76, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x43, 0x6c, 0x74, 0x76, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x24, + 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6c, 0x74, 0x76, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x43, 0x6c, 0x74, 0x76, 0x44, + 0x65, 0x6c, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0d, 0x6d, 0x69, 0x6e, 0x5f, 0x68, 0x74, 0x6c, 0x63, + 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x0b, 0x6d, 0x69, 0x6e, 0x48, 0x74, 0x6c, 0x63, 0x4d, 0x73, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0d, + 0x6d, 0x61, 0x78, 0x5f, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x48, 0x74, 0x6c, 0x63, + 0x4d, 0x73, 0x61, 0x74, 0x22, 0x5e, 0x0a, 0x0e, 0x4f, 0x66, 0x66, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x6d, + 0x74, 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, + 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x41, 0x6d, 0x74, 0x4d, 0x73, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0d, + 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x73, + 0x4d, 0x73, 0x61, 0x74, 0x22, 0x6f, 0x0a, 0x0d, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x42, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x11, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, + 0x65, 0x5f, 0x61, 0x6d, 0x74, 0x5f, 0x73, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x02, 0x30, 0x01, 0x52, 0x0f, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x41, 0x6d, + 0x74, 0x53, 0x61, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x61, 0x74, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x76, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x53, 0x61, 0x74, 0x50, 0x65, 0x72, + 0x56, 0x42, 0x79, 0x74, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x53, + 0x65, 0x6c, 0x66, 0x22, 0x36, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, + 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x30, 0x01, 0x52, + 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x22, 0x29, 0x0a, 0x0c, 0x50, + 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x65, 0x65, 0x72, 0x49, 0x64, 0x73, 0x2a, 0xa1, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, + 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x4f, 0x4e, 0x4c, 0x59, + 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, + 0x4f, 0x4f, 0x4e, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, + 0x54, 0x4f, 0x4d, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, + 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x50, 0x49, 0x4c, 0x4f, 0x54, 0x10, 0x04, 0x12, + 0x19, 0x0a, 0x15, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x41, 0x52, 0x4f, 0x4f, 0x4e, + 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x05, 0x2a, 0x59, 0x0a, 0x0c, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, + 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x10, 0x01, 0x12, + 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x56, 0x4f, 0x4b, 0x45, 0x44, + 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x49, + 0x52, 0x45, 0x44, 0x10, 0x03, 0x32, 0xe8, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x69, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, + 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, + 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x69, 0x67, + 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x2d, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2f, + 0x6c, 0x69, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -869,7 +1745,7 @@ func file_lit_sessions_proto_rawDescGZIP() []byte { } var file_lit_sessions_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_lit_sessions_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_lit_sessions_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_lit_sessions_proto_goTypes = []interface{}{ (SessionType)(0), // 0: litrpc.SessionType (SessionState)(0), // 1: litrpc.SessionState @@ -882,6 +1758,19 @@ var file_lit_sessions_proto_goTypes = []interface{}{ (*ListSessionsResponse)(nil), // 8: litrpc.ListSessionsResponse (*RevokeSessionRequest)(nil), // 9: litrpc.RevokeSessionRequest (*RevokeSessionResponse)(nil), // 10: litrpc.RevokeSessionResponse + (*RulesMap)(nil), // 11: litrpc.RulesMap + (*RuleValue)(nil), // 12: litrpc.RuleValue + (*RateLimit)(nil), // 13: litrpc.RateLimit + (*Rate)(nil), // 14: litrpc.Rate + (*HistoryLimit)(nil), // 15: litrpc.HistoryLimit + (*ChannelPolicyBounds)(nil), // 16: litrpc.ChannelPolicyBounds + (*OffChainBudget)(nil), // 17: litrpc.OffChainBudget + (*OnChainBudget)(nil), // 18: litrpc.OnChainBudget + (*SendToSelf)(nil), // 19: litrpc.SendToSelf + (*ChannelRestrict)(nil), // 20: litrpc.ChannelRestrict + (*PeerRestrict)(nil), // 21: litrpc.PeerRestrict + nil, // 22: litrpc.Session.AutopilotFeatureInfoEntry + nil, // 23: litrpc.RulesMap.RulesEntry } var file_lit_sessions_proto_depIdxs = []int32{ 0, // 0: litrpc.AddSessionRequest.session_type:type_name -> litrpc.SessionType @@ -890,19 +1779,33 @@ var file_lit_sessions_proto_depIdxs = []int32{ 1, // 3: litrpc.Session.session_state:type_name -> litrpc.SessionState 0, // 4: litrpc.Session.session_type:type_name -> litrpc.SessionType 6, // 5: litrpc.Session.macaroon_recipe:type_name -> litrpc.MacaroonRecipe - 3, // 6: litrpc.MacaroonRecipe.permissions:type_name -> litrpc.MacaroonPermission - 5, // 7: litrpc.ListSessionsResponse.sessions:type_name -> litrpc.Session - 2, // 8: litrpc.Sessions.AddSession:input_type -> litrpc.AddSessionRequest - 7, // 9: litrpc.Sessions.ListSessions:input_type -> litrpc.ListSessionsRequest - 9, // 10: litrpc.Sessions.RevokeSession:input_type -> litrpc.RevokeSessionRequest - 4, // 11: litrpc.Sessions.AddSession:output_type -> litrpc.AddSessionResponse - 8, // 12: litrpc.Sessions.ListSessions:output_type -> litrpc.ListSessionsResponse - 10, // 13: litrpc.Sessions.RevokeSession:output_type -> litrpc.RevokeSessionResponse - 11, // [11:14] is the sub-list for method output_type - 8, // [8:11] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 22, // 6: litrpc.Session.autopilot_feature_info:type_name -> litrpc.Session.AutopilotFeatureInfoEntry + 3, // 7: litrpc.MacaroonRecipe.permissions:type_name -> litrpc.MacaroonPermission + 5, // 8: litrpc.ListSessionsResponse.sessions:type_name -> litrpc.Session + 23, // 9: litrpc.RulesMap.rules:type_name -> litrpc.RulesMap.RulesEntry + 13, // 10: litrpc.RuleValue.rate_limit:type_name -> litrpc.RateLimit + 16, // 11: litrpc.RuleValue.chan_policy_bounds:type_name -> litrpc.ChannelPolicyBounds + 15, // 12: litrpc.RuleValue.history_limit:type_name -> litrpc.HistoryLimit + 17, // 13: litrpc.RuleValue.off_chain_budget:type_name -> litrpc.OffChainBudget + 18, // 14: litrpc.RuleValue.on_chain_budget:type_name -> litrpc.OnChainBudget + 19, // 15: litrpc.RuleValue.send_to_self:type_name -> litrpc.SendToSelf + 20, // 16: litrpc.RuleValue.channel_restrict:type_name -> litrpc.ChannelRestrict + 21, // 17: litrpc.RuleValue.peer_restrict:type_name -> litrpc.PeerRestrict + 14, // 18: litrpc.RateLimit.read_limit:type_name -> litrpc.Rate + 14, // 19: litrpc.RateLimit.write_limit:type_name -> litrpc.Rate + 11, // 20: litrpc.Session.AutopilotFeatureInfoEntry.value:type_name -> litrpc.RulesMap + 12, // 21: litrpc.RulesMap.RulesEntry.value:type_name -> litrpc.RuleValue + 2, // 22: litrpc.Sessions.AddSession:input_type -> litrpc.AddSessionRequest + 7, // 23: litrpc.Sessions.ListSessions:input_type -> litrpc.ListSessionsRequest + 9, // 24: litrpc.Sessions.RevokeSession:input_type -> litrpc.RevokeSessionRequest + 4, // 25: litrpc.Sessions.AddSession:output_type -> litrpc.AddSessionResponse + 8, // 26: litrpc.Sessions.ListSessions:output_type -> litrpc.ListSessionsResponse + 10, // 27: litrpc.Sessions.RevokeSession:output_type -> litrpc.RevokeSessionResponse + 25, // [25:28] is the sub-list for method output_type + 22, // [22:25] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_lit_sessions_proto_init() } @@ -1019,6 +1922,148 @@ func file_lit_sessions_proto_init() { return nil } } + file_lit_sessions_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RulesMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuleValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistoryLimit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelPolicyBounds); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OffChainBudget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OnChainBudget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendToSelf); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelRestrict); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lit_sessions_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerRestrict); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_lit_sessions_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*RuleValue_RateLimit)(nil), + (*RuleValue_ChanPolicyBounds)(nil), + (*RuleValue_HistoryLimit)(nil), + (*RuleValue_OffChainBudget)(nil), + (*RuleValue_OnChainBudget)(nil), + (*RuleValue_SendToSelf)(nil), + (*RuleValue_ChannelRestrict)(nil), + (*RuleValue_PeerRestrict)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1026,7 +2071,7 @@ func file_lit_sessions_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_lit_sessions_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/litrpc/lit-sessions.proto b/litrpc/lit-sessions.proto index 21d98878..27737f33 100644 --- a/litrpc/lit-sessions.proto +++ b/litrpc/lit-sessions.proto @@ -19,7 +19,7 @@ enum SessionType { TYPE_MACAROON_ADMIN = 1; TYPE_MACAROON_CUSTOM = 2; TYPE_UI_PASSWORD = 3; - reserved 4; + TYPE_AUTOPILOT = 4; TYPE_MACAROON_ACCOUNT = 5; } @@ -95,10 +95,7 @@ message Session { string account_id = 13; - /* - Field number 15 is reserved for future use. - */ - reserved 15; + map autopilot_feature_info = 15; /* The unix timestamp indicating the time at which the session was revoked. @@ -130,3 +127,125 @@ message RevokeSessionRequest { message RevokeSessionResponse { } + +message RulesMap { + /* + A map of rule name to RuleValue. The RuleValue should be parsed based on + the name of the rule. + */ + map rules = 1; +} + +message RuleValue { + oneof value { + RateLimit rate_limit = 1; + ChannelPolicyBounds chan_policy_bounds = 2; + HistoryLimit history_limit = 3; + OffChainBudget off_chain_budget = 4; + OnChainBudget on_chain_budget = 5; + SendToSelf send_to_self = 6; + ChannelRestrict channel_restrict = 7; + PeerRestrict peer_restrict = 8; + } +} + +message RateLimit { + /* + The rate limit for read-only calls. + */ + Rate read_limit = 1; + + /* + The rate limit for write/execution calls. + */ + Rate write_limit = 2; +} + +message Rate { + /* + The number of times a call is allowed in num_hours number of hours. + */ + uint32 iterations = 1; + + /* + The number of hours in which the iterations count takes place over. + */ + uint32 num_hours = 2; +} + +message HistoryLimit { + /* + The absolute unix timestamp in seconds before which no information should + be shared. This should only be set if duration is not set. + */ + uint64 start_time = 1 [jstype = JS_STRING]; + + /* + The maximum relative duration in seconds that a request is allowed to query + for. This should only be set if start_time is not set. + */ + uint64 duration = 2 [jstype = JS_STRING]; +} + +message ChannelPolicyBounds { + /* + The minimum base fee in msat that the autopilot can set for a channel. + */ + uint64 min_base_msat = 1 [jstype = JS_STRING]; + + /* + The maximum base fee in msat that the autopilot can set for a channel. + */ + uint64 max_base_msat = 2 [jstype = JS_STRING]; + + /* + The minimum ppm fee in msat that the autopilot can set for a channel. + */ + uint32 min_rate_ppm = 3; + + /* + The maximum ppm fee in msat that the autopilot can set for a channel. + */ + uint32 max_rate_ppm = 4; + + /* + The minimum cltv delta that the autopilot may set for a channel. + */ + uint32 min_cltv_delta = 5; + + /* + The maximum cltv delta that the autopilot may set for a channel. + */ + uint32 max_cltv_delta = 6; + + /* + The minimum htlc msat that the autopilot may set for a channel. + */ + uint64 min_htlc_msat = 7 [jstype = JS_STRING]; + + /* + The maximum htlc msat that the autopilot may set for a channel. + */ + uint64 max_htlc_msat = 8 [jstype = JS_STRING]; +} + +message OffChainBudget { + uint64 max_amt_msat = 1 [jstype = JS_STRING]; + uint64 max_fees_msat = 2 [jstype = JS_STRING]; +} + +message OnChainBudget { + uint64 absolute_amt_sats = 1 [jstype = JS_STRING]; + uint64 max_sat_per_v_byte = 2 [jstype = JS_STRING]; +} + +message SendToSelf { +} + +message ChannelRestrict { + repeated uint64 channel_ids = 1 [jstype = JS_STRING]; +} + +message PeerRestrict { + repeated string peer_ids = 1; +} \ No newline at end of file diff --git a/litrpc/sessions.pb.json.go b/litrpc/sessions.pb.json.go new file mode 100644 index 00000000..c49bd96d --- /dev/null +++ b/litrpc/sessions.pb.json.go @@ -0,0 +1,98 @@ +// Code generated by falafel 0.9.1. DO NOT EDIT. +// source: lit-sessions.proto + +package litrpc + +import ( + "context" + + gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "google.golang.org/grpc" + "google.golang.org/protobuf/encoding/protojson" +) + +func RegisterSessionsJSONCallbacks(registry map[string]func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error))) { + + marshaler := &gateway.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, + } + + registry["litrpc.Sessions.AddSession"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &AddSessionRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSessionsClient(conn) + resp, err := client.AddSession(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Sessions.ListSessions"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &ListSessionsRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSessionsClient(conn) + resp, err := client.ListSessions(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["litrpc.Sessions.RevokeSession"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &RevokeSessionRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSessionsClient(conn) + resp, err := client.RevokeSession(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } +}