diff --git a/app/src/types/generated/lnd_pb.d.ts b/app/src/types/generated/lnd_pb.d.ts index aa0dacb4..af42bb71 100644 --- a/app/src/types/generated/lnd_pb.d.ts +++ b/app/src/types/generated/lnd_pb.d.ts @@ -2023,6 +2023,9 @@ export class OpenChannelRequest extends jspb.Message { getRemoteMaxValueInFlightMsat(): number; setRemoteMaxValueInFlightMsat(value: number): void; + getRemoteMaxHtlcs(): number; + setRemoteMaxHtlcs(value: number): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): OpenChannelRequest.AsObject; static toObject(includeInstance: boolean, msg: OpenChannelRequest): OpenChannelRequest.AsObject; @@ -2049,6 +2052,7 @@ export namespace OpenChannelRequest { closeAddress: string, fundingShim?: FundingShim.AsObject, remoteMaxValueInFlightMsat: number, + remoteMaxHtlcs: number, } } @@ -2328,6 +2332,11 @@ export class FundingPsbtFinalize extends jspb.Message { getPendingChanId_asB64(): string; setPendingChanId(value: Uint8Array | string): void; + getFinalRawTx(): Uint8Array | string; + getFinalRawTx_asU8(): Uint8Array; + getFinalRawTx_asB64(): string; + setFinalRawTx(value: Uint8Array | string): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): FundingPsbtFinalize.AsObject; static toObject(includeInstance: boolean, msg: FundingPsbtFinalize): FundingPsbtFinalize.AsObject; @@ -2342,6 +2351,7 @@ export namespace FundingPsbtFinalize { export type AsObject = { signedPsbt: Uint8Array | string, pendingChanId: Uint8Array | string, + finalRawTx: Uint8Array | string, } } @@ -4486,6 +4496,9 @@ export class AbandonChannelRequest extends jspb.Message { getChannelPoint(): ChannelPoint | undefined; setChannelPoint(value?: ChannelPoint): void; + getPendingFundingShimOnly(): boolean; + setPendingFundingShimOnly(value: boolean): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): AbandonChannelRequest.AsObject; static toObject(includeInstance: boolean, msg: AbandonChannelRequest): AbandonChannelRequest.AsObject; @@ -4499,6 +4512,7 @@ export class AbandonChannelRequest extends jspb.Message { export namespace AbandonChannelRequest { export type AsObject = { channelPoint?: ChannelPoint.AsObject, + pendingFundingShimOnly: boolean, } } @@ -5247,6 +5261,63 @@ export namespace BakeMacaroonResponse { } } +export class MacaroonPermissionList extends jspb.Message { + clearPermissionsList(): void; + getPermissionsList(): Array; + setPermissionsList(value: Array): void; + addPermissions(value?: MacaroonPermission, index?: number): MacaroonPermission; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MacaroonPermissionList.AsObject; + static toObject(includeInstance: boolean, msg: MacaroonPermissionList): MacaroonPermissionList.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MacaroonPermissionList, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MacaroonPermissionList; + static deserializeBinaryFromReader(message: MacaroonPermissionList, reader: jspb.BinaryReader): MacaroonPermissionList; +} + +export namespace MacaroonPermissionList { + export type AsObject = { + permissionsList: Array, + } +} + +export class ListPermissionsRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListPermissionsRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListPermissionsRequest): ListPermissionsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListPermissionsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListPermissionsRequest; + static deserializeBinaryFromReader(message: ListPermissionsRequest, reader: jspb.BinaryReader): ListPermissionsRequest; +} + +export namespace ListPermissionsRequest { + export type AsObject = { + } +} + +export class ListPermissionsResponse extends jspb.Message { + getMethodPermissionsMap(): jspb.Map; + clearMethodPermissionsMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListPermissionsResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListPermissionsResponse): ListPermissionsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListPermissionsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListPermissionsResponse; + static deserializeBinaryFromReader(message: ListPermissionsResponse, reader: jspb.BinaryReader): ListPermissionsResponse; +} + +export namespace ListPermissionsResponse { + export type AsObject = { + methodPermissionsMap: Array<[string, MacaroonPermissionList.AsObject]>, + } +} + export class Failure extends jspb.Message { getCode(): Failure.FailureCodeMap[keyof Failure.FailureCodeMap]; setCode(value: Failure.FailureCodeMap[keyof Failure.FailureCodeMap]): void; @@ -5401,6 +5472,66 @@ export namespace ChannelUpdate { } } +export class MacaroonId extends jspb.Message { + getNonce(): Uint8Array | string; + getNonce_asU8(): Uint8Array; + getNonce_asB64(): string; + setNonce(value: Uint8Array | string): void; + + getStorageid(): Uint8Array | string; + getStorageid_asU8(): Uint8Array; + getStorageid_asB64(): string; + setStorageid(value: Uint8Array | string): void; + + clearOpsList(): void; + getOpsList(): Array; + setOpsList(value: Array): void; + addOps(value?: Op, index?: number): Op; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MacaroonId.AsObject; + static toObject(includeInstance: boolean, msg: MacaroonId): MacaroonId.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MacaroonId, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MacaroonId; + static deserializeBinaryFromReader(message: MacaroonId, reader: jspb.BinaryReader): MacaroonId; +} + +export namespace MacaroonId { + export type AsObject = { + nonce: Uint8Array | string, + storageid: Uint8Array | string, + opsList: Array, + } +} + +export class Op extends jspb.Message { + getEntity(): string; + setEntity(value: string): void; + + clearActionsList(): void; + getActionsList(): Array; + setActionsList(value: Array): void; + addActions(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Op.AsObject; + static toObject(includeInstance: boolean, msg: Op): Op.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Op, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Op; + static deserializeBinaryFromReader(message: Op, reader: jspb.BinaryReader): Op; +} + +export namespace Op { + export type AsObject = { + entity: string, + actionsList: Array, + } +} + export interface AddressTypeMap { WITNESS_PUBKEY_HASH: 0; NESTED_PUBKEY_HASH: 1; diff --git a/app/src/types/generated/lnd_pb.js b/app/src/types/generated/lnd_pb.js index b00807bf..014f924e 100644 --- a/app/src/types/generated/lnd_pb.js +++ b/app/src/types/generated/lnd_pb.js @@ -114,10 +114,14 @@ goog.exportSymbol('proto.lnrpc.ListPaymentsRequest', null, global); goog.exportSymbol('proto.lnrpc.ListPaymentsResponse', null, global); goog.exportSymbol('proto.lnrpc.ListPeersRequest', null, global); goog.exportSymbol('proto.lnrpc.ListPeersResponse', null, global); +goog.exportSymbol('proto.lnrpc.ListPermissionsRequest', null, global); +goog.exportSymbol('proto.lnrpc.ListPermissionsResponse', null, global); goog.exportSymbol('proto.lnrpc.ListUnspentRequest', null, global); goog.exportSymbol('proto.lnrpc.ListUnspentResponse', null, global); goog.exportSymbol('proto.lnrpc.MPPRecord', null, global); +goog.exportSymbol('proto.lnrpc.MacaroonId', null, global); goog.exportSymbol('proto.lnrpc.MacaroonPermission', null, global); +goog.exportSymbol('proto.lnrpc.MacaroonPermissionList', null, global); goog.exportSymbol('proto.lnrpc.MultiChanBackup', null, global); goog.exportSymbol('proto.lnrpc.NetworkInfo', null, global); goog.exportSymbol('proto.lnrpc.NetworkInfoRequest', null, global); @@ -131,6 +135,7 @@ goog.exportSymbol('proto.lnrpc.NodeMetricsRequest', null, global); goog.exportSymbol('proto.lnrpc.NodeMetricsResponse', null, global); goog.exportSymbol('proto.lnrpc.NodePair', null, global); goog.exportSymbol('proto.lnrpc.NodeUpdate', null, global); +goog.exportSymbol('proto.lnrpc.Op', null, global); goog.exportSymbol('proto.lnrpc.OpenChannelRequest', null, global); goog.exportSymbol('proto.lnrpc.OpenStatusUpdate', null, global); goog.exportSymbol('proto.lnrpc.OutPoint', null, global); @@ -14247,7 +14252,8 @@ proto.lnrpc.OpenChannelRequest.toObject = function(includeInstance, msg) { spendUnconfirmed: jspb.Message.getFieldWithDefault(msg, 12, false), closeAddress: jspb.Message.getFieldWithDefault(msg, 13, ""), fundingShim: (f = msg.getFundingShim()) && proto.lnrpc.FundingShim.toObject(includeInstance, f), - remoteMaxValueInFlightMsat: jspb.Message.getFieldWithDefault(msg, 15, 0) + remoteMaxValueInFlightMsat: jspb.Message.getFieldWithDefault(msg, 15, 0), + remoteMaxHtlcs: jspb.Message.getFieldWithDefault(msg, 16, 0) }; if (includeInstance) { @@ -14341,6 +14347,10 @@ proto.lnrpc.OpenChannelRequest.deserializeBinaryFromReader = function(msg, reade var value = /** @type {number} */ (reader.readUint64()); msg.setRemoteMaxValueInFlightMsat(value); break; + case 16: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRemoteMaxHtlcs(value); + break; default: reader.skipField(); break; @@ -14469,6 +14479,13 @@ proto.lnrpc.OpenChannelRequest.serializeBinaryToWriter = function(message, write f ); } + f = message.getRemoteMaxHtlcs(); + if (f !== 0) { + writer.writeUint32( + 16, + f + ); + } }; @@ -14725,6 +14742,21 @@ proto.lnrpc.OpenChannelRequest.prototype.setRemoteMaxValueInFlightMsat = functio }; +/** + * optional uint32 remote_max_htlcs = 16; + * @return {number} + */ +proto.lnrpc.OpenChannelRequest.prototype.getRemoteMaxHtlcs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); +}; + + +/** @param {number} value */ +proto.lnrpc.OpenChannelRequest.prototype.setRemoteMaxHtlcs = function(value) { + jspb.Message.setField(this, 16, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -16694,7 +16726,8 @@ proto.lnrpc.FundingPsbtFinalize.prototype.toObject = function(opt_includeInstanc proto.lnrpc.FundingPsbtFinalize.toObject = function(includeInstance, msg) { var f, obj = { signedPsbt: msg.getSignedPsbt_asB64(), - pendingChanId: msg.getPendingChanId_asB64() + pendingChanId: msg.getPendingChanId_asB64(), + finalRawTx: msg.getFinalRawTx_asB64() }; if (includeInstance) { @@ -16739,6 +16772,10 @@ proto.lnrpc.FundingPsbtFinalize.deserializeBinaryFromReader = function(msg, read var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPendingChanId(value); break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setFinalRawTx(value); + break; default: reader.skipField(); break; @@ -16782,6 +16819,13 @@ proto.lnrpc.FundingPsbtFinalize.serializeBinaryToWriter = function(message, writ f ); } + f = message.getFinalRawTx_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } }; @@ -16863,6 +16907,45 @@ proto.lnrpc.FundingPsbtFinalize.prototype.setPendingChanId = function(value) { }; +/** + * optional bytes final_raw_tx = 3; + * @return {!(string|Uint8Array)} + */ +proto.lnrpc.FundingPsbtFinalize.prototype.getFinalRawTx = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes final_raw_tx = 3; + * This is a type-conversion wrapper around `getFinalRawTx()` + * @return {string} + */ +proto.lnrpc.FundingPsbtFinalize.prototype.getFinalRawTx_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getFinalRawTx())); +}; + + +/** + * optional bytes final_raw_tx = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getFinalRawTx()` + * @return {!Uint8Array} + */ +proto.lnrpc.FundingPsbtFinalize.prototype.getFinalRawTx_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getFinalRawTx())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.lnrpc.FundingPsbtFinalize.prototype.setFinalRawTx = function(value) { + jspb.Message.setField(this, 3, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -31964,7 +32047,8 @@ proto.lnrpc.AbandonChannelRequest.prototype.toObject = function(opt_includeInsta */ proto.lnrpc.AbandonChannelRequest.toObject = function(includeInstance, msg) { var f, obj = { - channelPoint: (f = msg.getChannelPoint()) && proto.lnrpc.ChannelPoint.toObject(includeInstance, f) + channelPoint: (f = msg.getChannelPoint()) && proto.lnrpc.ChannelPoint.toObject(includeInstance, f), + pendingFundingShimOnly: jspb.Message.getFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -32006,6 +32090,10 @@ proto.lnrpc.AbandonChannelRequest.deserializeBinaryFromReader = function(msg, re reader.readMessage(value,proto.lnrpc.ChannelPoint.deserializeBinaryFromReader); msg.setChannelPoint(value); break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setPendingFundingShimOnly(value); + break; default: reader.skipField(); break; @@ -32043,6 +32131,13 @@ proto.lnrpc.AbandonChannelRequest.serializeBinaryToWriter = function(message, wr proto.lnrpc.ChannelPoint.serializeBinaryToWriter ); } + f = message.getPendingFundingShimOnly(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; @@ -32076,6 +32171,23 @@ proto.lnrpc.AbandonChannelRequest.prototype.hasChannelPoint = function() { }; +/** + * optional bool pending_funding_shim_only = 2; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.lnrpc.AbandonChannelRequest.prototype.getPendingFundingShimOnly = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); +}; + + +/** @param {boolean} value */ +proto.lnrpc.AbandonChannelRequest.prototype.setPendingFundingShimOnly = function(value) { + jspb.Message.setField(this, 2, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -37417,6 +37529,434 @@ proto.lnrpc.BakeMacaroonResponse.prototype.setMacaroon = function(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.lnrpc.MacaroonPermissionList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.lnrpc.MacaroonPermissionList.repeatedFields_, null); +}; +goog.inherits(proto.lnrpc.MacaroonPermissionList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.lnrpc.MacaroonPermissionList.displayName = 'proto.lnrpc.MacaroonPermissionList'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.lnrpc.MacaroonPermissionList.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.lnrpc.MacaroonPermissionList.prototype.toObject = function(opt_includeInstance) { + return proto.lnrpc.MacaroonPermissionList.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.lnrpc.MacaroonPermissionList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.MacaroonPermissionList.toObject = function(includeInstance, msg) { + var f, obj = { + permissionsList: jspb.Message.toObjectList(msg.getPermissionsList(), + proto.lnrpc.MacaroonPermission.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.lnrpc.MacaroonPermissionList} + */ +proto.lnrpc.MacaroonPermissionList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.lnrpc.MacaroonPermissionList; + return proto.lnrpc.MacaroonPermissionList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.lnrpc.MacaroonPermissionList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.lnrpc.MacaroonPermissionList} + */ +proto.lnrpc.MacaroonPermissionList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.lnrpc.MacaroonPermission; + reader.readMessage(value,proto.lnrpc.MacaroonPermission.deserializeBinaryFromReader); + msg.addPermissions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.lnrpc.MacaroonPermissionList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.lnrpc.MacaroonPermissionList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.lnrpc.MacaroonPermissionList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.MacaroonPermissionList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPermissionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.lnrpc.MacaroonPermission.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated MacaroonPermission permissions = 1; + * @return {!Array.} + */ +proto.lnrpc.MacaroonPermissionList.prototype.getPermissionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.lnrpc.MacaroonPermission, 1)); +}; + + +/** @param {!Array.} value */ +proto.lnrpc.MacaroonPermissionList.prototype.setPermissionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.lnrpc.MacaroonPermission=} opt_value + * @param {number=} opt_index + * @return {!proto.lnrpc.MacaroonPermission} + */ +proto.lnrpc.MacaroonPermissionList.prototype.addPermissions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.lnrpc.MacaroonPermission, opt_index); +}; + + +proto.lnrpc.MacaroonPermissionList.prototype.clearPermissionsList = function() { + this.setPermissionsList([]); +}; + + + +/** + * 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.lnrpc.ListPermissionsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.lnrpc.ListPermissionsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.lnrpc.ListPermissionsRequest.displayName = 'proto.lnrpc.ListPermissionsRequest'; +} + + +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.lnrpc.ListPermissionsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.lnrpc.ListPermissionsRequest.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.lnrpc.ListPermissionsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.ListPermissionsRequest.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.lnrpc.ListPermissionsRequest} + */ +proto.lnrpc.ListPermissionsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.lnrpc.ListPermissionsRequest; + return proto.lnrpc.ListPermissionsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.lnrpc.ListPermissionsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.lnrpc.ListPermissionsRequest} + */ +proto.lnrpc.ListPermissionsRequest.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.lnrpc.ListPermissionsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.lnrpc.ListPermissionsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.lnrpc.ListPermissionsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.ListPermissionsRequest.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.lnrpc.ListPermissionsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.lnrpc.ListPermissionsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.lnrpc.ListPermissionsResponse.displayName = 'proto.lnrpc.ListPermissionsResponse'; +} + + +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.lnrpc.ListPermissionsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.lnrpc.ListPermissionsResponse.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.lnrpc.ListPermissionsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.ListPermissionsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + methodPermissionsMap: (f = msg.getMethodPermissionsMap()) ? f.toObject(includeInstance, proto.lnrpc.MacaroonPermissionList.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.lnrpc.ListPermissionsResponse} + */ +proto.lnrpc.ListPermissionsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.lnrpc.ListPermissionsResponse; + return proto.lnrpc.ListPermissionsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.lnrpc.ListPermissionsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.lnrpc.ListPermissionsResponse} + */ +proto.lnrpc.ListPermissionsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getMethodPermissionsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.lnrpc.MacaroonPermissionList.deserializeBinaryFromReader); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.lnrpc.ListPermissionsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.lnrpc.ListPermissionsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.lnrpc.ListPermissionsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.ListPermissionsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMethodPermissionsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.lnrpc.MacaroonPermissionList.serializeBinaryToWriter); + } +}; + + +/** + * map method_permissions = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.lnrpc.ListPermissionsResponse.prototype.getMethodPermissionsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.lnrpc.MacaroonPermissionList)); +}; + + +proto.lnrpc.ListPermissionsResponse.prototype.clearMethodPermissionsMap = function() { + this.getMethodPermissionsMap().clear(); +}; + + + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -38332,6 +38872,466 @@ proto.lnrpc.ChannelUpdate.prototype.setExtraOpaqueData = function(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.lnrpc.MacaroonId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.lnrpc.MacaroonId.repeatedFields_, null); +}; +goog.inherits(proto.lnrpc.MacaroonId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.lnrpc.MacaroonId.displayName = 'proto.lnrpc.MacaroonId'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.lnrpc.MacaroonId.repeatedFields_ = [3]; + + + +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.lnrpc.MacaroonId.prototype.toObject = function(opt_includeInstance) { + return proto.lnrpc.MacaroonId.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.lnrpc.MacaroonId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.MacaroonId.toObject = function(includeInstance, msg) { + var f, obj = { + nonce: msg.getNonce_asB64(), + storageid: msg.getStorageid_asB64(), + opsList: jspb.Message.toObjectList(msg.getOpsList(), + proto.lnrpc.Op.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.lnrpc.MacaroonId} + */ +proto.lnrpc.MacaroonId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.lnrpc.MacaroonId; + return proto.lnrpc.MacaroonId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.lnrpc.MacaroonId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.lnrpc.MacaroonId} + */ +proto.lnrpc.MacaroonId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNonce(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStorageid(value); + break; + case 3: + var value = new proto.lnrpc.Op; + reader.readMessage(value,proto.lnrpc.Op.deserializeBinaryFromReader); + msg.addOps(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.lnrpc.MacaroonId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.lnrpc.MacaroonId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.lnrpc.MacaroonId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.MacaroonId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNonce_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getStorageid_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getOpsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.lnrpc.Op.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes nonce = 1; + * @return {!(string|Uint8Array)} + */ +proto.lnrpc.MacaroonId.prototype.getNonce = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes nonce = 1; + * This is a type-conversion wrapper around `getNonce()` + * @return {string} + */ +proto.lnrpc.MacaroonId.prototype.getNonce_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNonce())); +}; + + +/** + * optional bytes nonce = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNonce()` + * @return {!Uint8Array} + */ +proto.lnrpc.MacaroonId.prototype.getNonce_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNonce())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.lnrpc.MacaroonId.prototype.setNonce = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes storageId = 2; + * @return {!(string|Uint8Array)} + */ +proto.lnrpc.MacaroonId.prototype.getStorageid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes storageId = 2; + * This is a type-conversion wrapper around `getStorageid()` + * @return {string} + */ +proto.lnrpc.MacaroonId.prototype.getStorageid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStorageid())); +}; + + +/** + * optional bytes storageId = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStorageid()` + * @return {!Uint8Array} + */ +proto.lnrpc.MacaroonId.prototype.getStorageid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStorageid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.lnrpc.MacaroonId.prototype.setStorageid = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * repeated Op ops = 3; + * @return {!Array.} + */ +proto.lnrpc.MacaroonId.prototype.getOpsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.lnrpc.Op, 3)); +}; + + +/** @param {!Array.} value */ +proto.lnrpc.MacaroonId.prototype.setOpsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.lnrpc.Op=} opt_value + * @param {number=} opt_index + * @return {!proto.lnrpc.Op} + */ +proto.lnrpc.MacaroonId.prototype.addOps = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.lnrpc.Op, opt_index); +}; + + +proto.lnrpc.MacaroonId.prototype.clearOpsList = function() { + this.setOpsList([]); +}; + + + +/** + * 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.lnrpc.Op = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.lnrpc.Op.repeatedFields_, null); +}; +goog.inherits(proto.lnrpc.Op, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.lnrpc.Op.displayName = 'proto.lnrpc.Op'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.lnrpc.Op.repeatedFields_ = [2]; + + + +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.lnrpc.Op.prototype.toObject = function(opt_includeInstance) { + return proto.lnrpc.Op.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.lnrpc.Op} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.Op.toObject = function(includeInstance, msg) { + var f, obj = { + entity: jspb.Message.getFieldWithDefault(msg, 1, ""), + actionsList: jspb.Message.getRepeatedField(msg, 2) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.lnrpc.Op} + */ +proto.lnrpc.Op.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.lnrpc.Op; + return proto.lnrpc.Op.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.lnrpc.Op} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.lnrpc.Op} + */ +proto.lnrpc.Op.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.setEntity(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addActions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.lnrpc.Op.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.lnrpc.Op.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.lnrpc.Op} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.lnrpc.Op.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEntity(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getActionsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * optional string entity = 1; + * @return {string} + */ +proto.lnrpc.Op.prototype.getEntity = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.lnrpc.Op.prototype.setEntity = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * repeated string actions = 2; + * @return {!Array.} + */ +proto.lnrpc.Op.prototype.getActionsList = function() { + return /** @type {!Array.} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** @param {!Array.} value */ +proto.lnrpc.Op.prototype.setActionsList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.lnrpc.Op.prototype.addActions = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.lnrpc.Op.prototype.clearActionsList = function() { + this.setActionsList([]); +}; + + /** * @enum {number} */ diff --git a/app/src/types/generated/lnd_pb_service.d.ts b/app/src/types/generated/lnd_pb_service.d.ts index f81dc607..24c39163 100644 --- a/app/src/types/generated/lnd_pb_service.d.ts +++ b/app/src/types/generated/lnd_pb_service.d.ts @@ -508,6 +508,15 @@ type LightningBakeMacaroon = { readonly responseType: typeof lnd_pb.BakeMacaroonResponse; }; +type LightningListPermissions = { + readonly methodName: string; + readonly service: typeof Lightning; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof lnd_pb.ListPermissionsRequest; + readonly responseType: typeof lnd_pb.ListPermissionsResponse; +}; + export class Lightning { static readonly serviceName: string; static readonly WalletBalance: LightningWalletBalance; @@ -566,6 +575,7 @@ export class Lightning { static readonly RestoreChannelBackups: LightningRestoreChannelBackups; static readonly SubscribeChannelBackups: LightningSubscribeChannelBackups; static readonly BakeMacaroon: LightningBakeMacaroon; + static readonly ListPermissions: LightningListPermissions; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -1016,5 +1026,14 @@ export class LightningClient { requestMessage: lnd_pb.BakeMacaroonRequest, callback: (error: ServiceError|null, responseMessage: lnd_pb.BakeMacaroonResponse|null) => void ): UnaryResponse; + listPermissions( + requestMessage: lnd_pb.ListPermissionsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: lnd_pb.ListPermissionsResponse|null) => void + ): UnaryResponse; + listPermissions( + requestMessage: lnd_pb.ListPermissionsRequest, + callback: (error: ServiceError|null, responseMessage: lnd_pb.ListPermissionsResponse|null) => void + ): UnaryResponse; } diff --git a/app/src/types/generated/lnd_pb_service.js b/app/src/types/generated/lnd_pb_service.js index aad665ba..8a9c3b22 100644 --- a/app/src/types/generated/lnd_pb_service.js +++ b/app/src/types/generated/lnd_pb_service.js @@ -514,6 +514,15 @@ Lightning.BakeMacaroon = { responseType: lnd_pb.BakeMacaroonResponse }; +Lightning.ListPermissions = { + methodName: "ListPermissions", + service: Lightning, + requestStream: false, + responseStream: false, + requestType: lnd_pb.ListPermissionsRequest, + responseType: lnd_pb.ListPermissionsResponse +}; + exports.Lightning = Lightning; function LightningClient(serviceHost, options) { @@ -2363,5 +2372,36 @@ LightningClient.prototype.bakeMacaroon = function bakeMacaroon(requestMessage, m }; }; +LightningClient.prototype.listPermissions = function listPermissions(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Lightning.ListPermissions, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + exports.LightningClient = LightningClient; diff --git a/app/src/types/generated/loop_pb.d.ts b/app/src/types/generated/loop_pb.d.ts index 10ab977f..e50dc21f 100644 --- a/app/src/types/generated/loop_pb.d.ts +++ b/app/src/types/generated/loop_pb.d.ts @@ -644,6 +644,12 @@ export class LiquidityParameters extends jspb.Message { getAutoMaxInFlight(): number; setAutoMaxInFlight(value: number): void; + getMinSwapAmount(): number; + setMinSwapAmount(value: number): void; + + getMaxSwapAmount(): number; + setMaxSwapAmount(value: number): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LiquidityParameters.AsObject; static toObject(includeInstance: boolean, msg: LiquidityParameters): LiquidityParameters.AsObject; @@ -669,6 +675,8 @@ export namespace LiquidityParameters { autoOutBudgetSat: number, autoOutBudgetStartSec: number, autoMaxInFlight: number, + minSwapAmount: number, + maxSwapAmount: number, } } diff --git a/app/src/types/generated/loop_pb.js b/app/src/types/generated/loop_pb.js index f54a49e8..af31eeb6 100644 --- a/app/src/types/generated/loop_pb.js +++ b/app/src/types/generated/loop_pb.js @@ -4400,7 +4400,9 @@ proto.looprpc.LiquidityParameters.toObject = function(includeInstance, msg) { autoLoopOut: jspb.Message.getFieldWithDefault(msg, 10, false), autoOutBudgetSat: jspb.Message.getFieldWithDefault(msg, 11, 0), autoOutBudgetStartSec: jspb.Message.getFieldWithDefault(msg, 12, 0), - autoMaxInFlight: jspb.Message.getFieldWithDefault(msg, 13, 0) + autoMaxInFlight: jspb.Message.getFieldWithDefault(msg, 13, 0), + minSwapAmount: jspb.Message.getFieldWithDefault(msg, 14, 0), + maxSwapAmount: jspb.Message.getFieldWithDefault(msg, 15, 0) }; if (includeInstance) { @@ -4490,6 +4492,14 @@ proto.looprpc.LiquidityParameters.deserializeBinaryFromReader = function(msg, re var value = /** @type {number} */ (reader.readUint64()); msg.setAutoMaxInFlight(value); break; + case 14: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMinSwapAmount(value); + break; + case 15: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMaxSwapAmount(value); + break; default: reader.skipField(); break; @@ -4611,6 +4621,20 @@ proto.looprpc.LiquidityParameters.serializeBinaryToWriter = function(message, wr f ); } + f = message.getMinSwapAmount(); + if (f !== 0) { + writer.writeUint64( + 14, + f + ); + } + f = message.getMaxSwapAmount(); + if (f !== 0) { + writer.writeUint64( + 15, + f + ); + } }; @@ -4827,6 +4851,36 @@ proto.looprpc.LiquidityParameters.prototype.setAutoMaxInFlight = function(value) }; +/** + * optional uint64 min_swap_amount = 14; + * @return {number} + */ +proto.looprpc.LiquidityParameters.prototype.getMinSwapAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); +}; + + +/** @param {number} value */ +proto.looprpc.LiquidityParameters.prototype.setMinSwapAmount = function(value) { + jspb.Message.setField(this, 14, value); +}; + + +/** + * optional uint64 max_swap_amount = 15; + * @return {number} + */ +proto.looprpc.LiquidityParameters.prototype.getMaxSwapAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0)); +}; + + +/** @param {number} value */ +proto.looprpc.LiquidityParameters.prototype.setMaxSwapAmount = function(value) { + jspb.Message.setField(this, 15, value); +}; + + /** * Generated by JsPbCodeGenerator. diff --git a/proto/lnd.proto b/proto/lnd.proto index ee5504d7..782ea3c7 100644 --- a/proto/lnd.proto +++ b/proto/lnd.proto @@ -235,8 +235,10 @@ service Lightning { /* lncli: `abandonchannel` AbandonChannel removes all channel state from the database except for a close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. Only available - when in debug builds of lnd. + channels due to bugs fixed in newer versions of lnd. This method can also be + used to remove externally funded channels where the funding transaction was + never broadcast. Only available for non-externally funded channels in dev + build. */ rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse); @@ -491,6 +493,13 @@ service Lightning { offline. */ rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse); + + /* lncli: `listpermissions` + ListPermissions lists all RPC method URIs and their required macaroon + permissions to access them. + */ + rpc ListPermissions (ListPermissionsRequest) + returns (ListPermissionsResponse); } message Utxo { @@ -1672,6 +1681,12 @@ message OpenChannelRequest { the channel. It only applies to the remote party. */ uint64 remote_max_value_in_flight_msat = 15; + + /* + The maximum number of concurrent HTLCs we will allow the remote party to add + to the commitment transaction. + */ + uint32 remote_max_htlcs = 16; } message OpenStatusUpdate { oneof update { @@ -1817,12 +1832,19 @@ message FundingPsbtFinalize { /* The funded PSBT that contains all witness data to send the exact channel capacity amount to the PK script returned in the open channel message in a - previous step. + previous step. Cannot be set at the same time as final_raw_tx. */ bytes signed_psbt = 1; // The pending channel ID of the channel to get the PSBT for. bytes pending_chan_id = 2; + + /* + As an alternative to the signed PSBT with all witness data, the final raw + wire format transaction can also be specified directly. Cannot be set at the + same time as signed_psbt. + */ + bytes final_raw_tx = 3; } message FundingTransitionMsg { @@ -3039,6 +3061,8 @@ message DeleteAllPaymentsResponse { message AbandonChannelRequest { ChannelPoint channel_point = 1; + + bool pending_funding_shim_only = 2; } message AbandonChannelResponse { @@ -3333,6 +3357,21 @@ message BakeMacaroonResponse { string macaroon = 1; } +message MacaroonPermissionList { + // A list of macaroon permissions. + repeated MacaroonPermission permissions = 1; +} + +message ListPermissionsRequest { +} +message ListPermissionsResponse { + /* + A map between all RPC method URIs and their required macaroon permissions to + access them. + */ + map method_permissions = 1; +} + message Failure { enum FailureCode { /* @@ -3495,3 +3534,14 @@ message ChannelUpdate { */ bytes extra_opaque_data = 12; } + +message MacaroonId { + bytes nonce = 1; + bytes storageId = 2; + repeated Op ops = 3; +} + +message Op { + string entity = 1; + repeated string actions = 2; +} diff --git a/proto/loop.proto b/proto/loop.proto index 5aa75696..267d3e93 100644 --- a/proto/loop.proto +++ b/proto/loop.proto @@ -808,6 +808,20 @@ message LiquidityParameters { flight at any point in time. */ uint64 auto_max_in_flight = 13; + + /* + The minimum amount, expressed in satoshis, that the autoloop client will + dispatch a swap for. This value is subject to the server-side limits + specified by the LoopOutTerms endpoint. + */ + uint64 min_swap_amount = 14; + + /* + The maximum amount, expressed in satoshis, that the autoloop client will + dispatch a swap for. This value is subject to the server-side limits + specified by the LoopOutTerms endpoint. + */ + uint64 max_swap_amount = 15; } enum LiquidityRuleType {