diff --git a/app/src/types/generated/loop_pb.d.ts b/app/src/types/generated/loop_pb.d.ts index 93d9189e..1ac4b4b7 100644 --- a/app/src/types/generated/loop_pb.d.ts +++ b/app/src/types/generated/loop_pb.d.ts @@ -753,6 +753,12 @@ export class LiquidityParameters extends jspb.Message { getAutoloopDestAddress(): string; setAutoloopDestAddress(value: string): void; + getAutoloopBudgetRefreshPeriodSec(): string; + setAutoloopBudgetRefreshPeriodSec(value: string): void; + + getAutoloopBudgetLastRefresh(): string; + setAutoloopBudgetLastRefresh(value: string): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LiquidityParameters.AsObject; static toObject(includeInstance: boolean, msg: LiquidityParameters): LiquidityParameters.AsObject; @@ -783,6 +789,8 @@ export namespace LiquidityParameters { maxSwapAmount: string, htlcConfTarget: number, autoloopDestAddress: string, + autoloopBudgetRefreshPeriodSec: string, + autoloopBudgetLastRefresh: string, } } diff --git a/app/src/types/generated/loop_pb.js b/app/src/types/generated/loop_pb.js index 17c3c22e..b51357e0 100644 --- a/app/src/types/generated/loop_pb.js +++ b/app/src/types/generated/loop_pb.js @@ -5139,7 +5139,9 @@ proto.looprpc.LiquidityParameters.toObject = function(includeInstance, msg) { minSwapAmount: jspb.Message.getFieldWithDefault(msg, 14, "0"), maxSwapAmount: jspb.Message.getFieldWithDefault(msg, 15, "0"), htlcConfTarget: jspb.Message.getFieldWithDefault(msg, 17, 0), - autoloopDestAddress: jspb.Message.getFieldWithDefault(msg, 18, "") + autoloopDestAddress: jspb.Message.getFieldWithDefault(msg, 18, ""), + autoloopBudgetRefreshPeriodSec: jspb.Message.getFieldWithDefault(msg, 19, "0"), + autoloopBudgetLastRefresh: jspb.Message.getFieldWithDefault(msg, 20, "0") }; if (includeInstance) { @@ -5249,6 +5251,14 @@ proto.looprpc.LiquidityParameters.deserializeBinaryFromReader = function(msg, re var value = /** @type {string} */ (reader.readString()); msg.setAutoloopDestAddress(value); break; + case 19: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setAutoloopBudgetRefreshPeriodSec(value); + break; + case 20: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setAutoloopBudgetLastRefresh(value); + break; default: reader.skipField(); break; @@ -5405,6 +5415,20 @@ proto.looprpc.LiquidityParameters.serializeBinaryToWriter = function(message, wr f ); } + f = message.getAutoloopBudgetRefreshPeriodSec(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 19, + f + ); + } + f = message.getAutoloopBudgetLastRefresh(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 20, + f + ); + } }; @@ -5696,6 +5720,36 @@ proto.looprpc.LiquidityParameters.prototype.setAutoloopDestAddress = function(va }; +/** + * optional uint64 autoloop_budget_refresh_period_sec = 19; + * @return {string} + */ +proto.looprpc.LiquidityParameters.prototype.getAutoloopBudgetRefreshPeriodSec = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 19, "0")); +}; + + +/** @param {string} value */ +proto.looprpc.LiquidityParameters.prototype.setAutoloopBudgetRefreshPeriodSec = function(value) { + jspb.Message.setProto3StringIntField(this, 19, value); +}; + + +/** + * optional uint64 autoloop_budget_last_refresh = 20; + * @return {string} + */ +proto.looprpc.LiquidityParameters.prototype.getAutoloopBudgetLastRefresh = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 20, "0")); +}; + + +/** @param {string} value */ +proto.looprpc.LiquidityParameters.prototype.setAutoloopBudgetLastRefresh = function(value) { + jspb.Message.setProto3StringIntField(this, 20, value); +}; + + /** * Generated by JsPbCodeGenerator. diff --git a/app/src/types/generated/swapserverrpc/server_pb.d.ts b/app/src/types/generated/swapserverrpc/server_pb.d.ts index be49cb12..4b314b59 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.d.ts +++ b/app/src/types/generated/swapserverrpc/server_pb.d.ts @@ -224,6 +224,11 @@ export class ServerLoopInRequest extends jspb.Message { getSenderKey_asB64(): string; setSenderKey(value: Uint8Array | string): void; + getSenderInternalPubkey(): Uint8Array | string; + getSenderInternalPubkey_asU8(): Uint8Array; + getSenderInternalPubkey_asB64(): string; + setSenderInternalPubkey(value: Uint8Array | string): void; + getSwapHash(): Uint8Array | string; getSwapHash_asU8(): Uint8Array; getSwapHash_asB64(): string; @@ -262,6 +267,7 @@ export class ServerLoopInRequest extends jspb.Message { export namespace ServerLoopInRequest { export type AsObject = { senderKey: Uint8Array | string, + senderInternalPubkey: Uint8Array | string, swapHash: Uint8Array | string, amt: string, swapInvoice: string, @@ -278,6 +284,11 @@ export class ServerLoopInResponse extends jspb.Message { getReceiverKey_asB64(): string; setReceiverKey(value: Uint8Array | string): void; + getReceiverInternalPubkey(): Uint8Array | string; + getReceiverInternalPubkey_asU8(): Uint8Array; + getReceiverInternalPubkey_asB64(): string; + setReceiverInternalPubkey(value: Uint8Array | string): void; + getExpiry(): number; setExpiry(value: number): void; @@ -297,6 +308,7 @@ export class ServerLoopInResponse extends jspb.Message { export namespace ServerLoopInResponse { export type AsObject = { receiverKey: Uint8Array | string, + receiverInternalPubkey: Uint8Array | string, expiry: number, serverMessage: string, } @@ -896,6 +908,54 @@ export namespace MuSig2SignSweepRes { } } +export class ServerPushKeyReq extends jspb.Message { + getProtocolVersion(): ProtocolVersionMap[keyof ProtocolVersionMap]; + setProtocolVersion(value: ProtocolVersionMap[keyof ProtocolVersionMap]): void; + + getSwapHash(): Uint8Array | string; + getSwapHash_asU8(): Uint8Array; + getSwapHash_asB64(): string; + setSwapHash(value: Uint8Array | string): void; + + getInternalPrivkey(): Uint8Array | string; + getInternalPrivkey_asU8(): Uint8Array; + getInternalPrivkey_asB64(): string; + setInternalPrivkey(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerPushKeyReq.AsObject; + static toObject(includeInstance: boolean, msg: ServerPushKeyReq): ServerPushKeyReq.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerPushKeyReq, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerPushKeyReq; + static deserializeBinaryFromReader(message: ServerPushKeyReq, reader: jspb.BinaryReader): ServerPushKeyReq; +} + +export namespace ServerPushKeyReq { + export type AsObject = { + protocolVersion: ProtocolVersionMap[keyof ProtocolVersionMap], + swapHash: Uint8Array | string, + internalPrivkey: Uint8Array | string, + } +} + +export class ServerPushKeyRes extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerPushKeyRes.AsObject; + static toObject(includeInstance: boolean, msg: ServerPushKeyRes): ServerPushKeyRes.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerPushKeyRes, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerPushKeyRes; + static deserializeBinaryFromReader(message: ServerPushKeyRes, reader: jspb.BinaryReader): ServerPushKeyRes; +} + +export namespace ServerPushKeyRes { + export type AsObject = { + } +} + export interface ProtocolVersionMap { LEGACY: 0; MULTI_LOOP_OUT: 1; @@ -908,6 +968,7 @@ export interface ProtocolVersionMap { PROBE: 8; ROUTING_PLUGIN: 9; HTLC_V3: 10; + MUSIG2: 11; } export const ProtocolVersion: ProtocolVersionMap; diff --git a/app/src/types/generated/swapserverrpc/server_pb.js b/app/src/types/generated/swapserverrpc/server_pb.js index b7c554c4..0deffb26 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.js +++ b/app/src/types/generated/swapserverrpc/server_pb.js @@ -45,6 +45,8 @@ goog.exportSymbol('proto.looprpc.ServerLoopOutTerms', null, global); goog.exportSymbol('proto.looprpc.ServerLoopOutTermsRequest', null, global); goog.exportSymbol('proto.looprpc.ServerProbeRequest', null, global); goog.exportSymbol('proto.looprpc.ServerProbeResponse', null, global); +goog.exportSymbol('proto.looprpc.ServerPushKeyReq', null, global); +goog.exportSymbol('proto.looprpc.ServerPushKeyRes', null, global); goog.exportSymbol('proto.looprpc.ServerSwapState', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopInUpdatesResponse', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopOutUpdatesResponse', null, global); @@ -1615,6 +1617,7 @@ proto.looprpc.ServerLoopInRequest.prototype.toObject = function(opt_includeInsta proto.looprpc.ServerLoopInRequest.toObject = function(includeInstance, msg) { var f, obj = { senderKey: msg.getSenderKey_asB64(), + senderInternalPubkey: msg.getSenderInternalPubkey_asB64(), swapHash: msg.getSwapHash_asB64(), amt: jspb.Message.getFieldWithDefault(msg, 3, "0"), swapInvoice: jspb.Message.getFieldWithDefault(msg, 4, ""), @@ -1662,6 +1665,10 @@ proto.looprpc.ServerLoopInRequest.deserializeBinaryFromReader = function(msg, re var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSenderKey(value); break; + case 9: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSenderInternalPubkey(value); + break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSwapHash(value); @@ -1726,6 +1733,13 @@ proto.looprpc.ServerLoopInRequest.serializeBinaryToWriter = function(message, wr f ); } + f = message.getSenderInternalPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 9, + f + ); + } f = message.getSwapHash_asU8(); if (f.length > 0) { writer.writeBytes( @@ -1817,6 +1831,45 @@ proto.looprpc.ServerLoopInRequest.prototype.setSenderKey = function(value) { }; +/** + * optional bytes sender_internal_pubkey = 9; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerLoopInRequest.prototype.getSenderInternalPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * optional bytes sender_internal_pubkey = 9; + * This is a type-conversion wrapper around `getSenderInternalPubkey()` + * @return {string} + */ +proto.looprpc.ServerLoopInRequest.prototype.getSenderInternalPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSenderInternalPubkey())); +}; + + +/** + * optional bytes sender_internal_pubkey = 9; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSenderInternalPubkey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerLoopInRequest.prototype.getSenderInternalPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSenderInternalPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.looprpc.ServerLoopInRequest.prototype.setSenderInternalPubkey = function(value) { + jspb.Message.setProto3BytesField(this, 9, value); +}; + + /** * optional bytes swap_hash = 2; * @return {!(string|Uint8Array)} @@ -2018,6 +2071,7 @@ proto.looprpc.ServerLoopInResponse.prototype.toObject = function(opt_includeInst proto.looprpc.ServerLoopInResponse.toObject = function(includeInstance, msg) { var f, obj = { receiverKey: msg.getReceiverKey_asB64(), + receiverInternalPubkey: msg.getReceiverInternalPubkey_asB64(), expiry: jspb.Message.getFieldWithDefault(msg, 2, 0), serverMessage: jspb.Message.getFieldWithDefault(msg, 3, "") }; @@ -2060,6 +2114,10 @@ proto.looprpc.ServerLoopInResponse.deserializeBinaryFromReader = function(msg, r var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setReceiverKey(value); break; + case 9: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setReceiverInternalPubkey(value); + break; case 2: var value = /** @type {number} */ (reader.readInt32()); msg.setExpiry(value); @@ -2104,6 +2162,13 @@ proto.looprpc.ServerLoopInResponse.serializeBinaryToWriter = function(message, w f ); } + f = message.getReceiverInternalPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 9, + f + ); + } f = message.getExpiry(); if (f !== 0) { writer.writeInt32( @@ -2160,6 +2225,45 @@ proto.looprpc.ServerLoopInResponse.prototype.setReceiverKey = function(value) { }; +/** + * optional bytes receiver_internal_pubkey = 9; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerLoopInResponse.prototype.getReceiverInternalPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * optional bytes receiver_internal_pubkey = 9; + * This is a type-conversion wrapper around `getReceiverInternalPubkey()` + * @return {string} + */ +proto.looprpc.ServerLoopInResponse.prototype.getReceiverInternalPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getReceiverInternalPubkey())); +}; + + +/** + * optional bytes receiver_internal_pubkey = 9; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getReceiverInternalPubkey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerLoopInResponse.prototype.getReceiverInternalPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getReceiverInternalPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.looprpc.ServerLoopInResponse.prototype.setReceiverInternalPubkey = function(value) { + jspb.Message.setProto3BytesField(this, 9, value); +}; + + /** * optional int32 expiry = 2; * @return {number} @@ -6567,6 +6671,366 @@ proto.looprpc.MuSig2SignSweepRes.prototype.setPartialSignature = 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.looprpc.ServerPushKeyReq = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerPushKeyReq, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.looprpc.ServerPushKeyReq.displayName = 'proto.looprpc.ServerPushKeyReq'; +} + + +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.looprpc.ServerPushKeyReq.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerPushKeyReq.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.looprpc.ServerPushKeyReq} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerPushKeyReq.toObject = function(includeInstance, msg) { + var f, obj = { + protocolVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), + swapHash: msg.getSwapHash_asB64(), + internalPrivkey: msg.getInternalPrivkey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.looprpc.ServerPushKeyReq} + */ +proto.looprpc.ServerPushKeyReq.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerPushKeyReq; + return proto.looprpc.ServerPushKeyReq.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerPushKeyReq} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerPushKeyReq} + */ +proto.looprpc.ServerPushKeyReq.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.looprpc.ProtocolVersion} */ (reader.readEnum()); + msg.setProtocolVersion(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSwapHash(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setInternalPrivkey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerPushKeyReq.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerPushKeyReq.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerPushKeyReq} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerPushKeyReq.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProtocolVersion(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getSwapHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getInternalPrivkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional ProtocolVersion protocol_version = 1; + * @return {!proto.looprpc.ProtocolVersion} + */ +proto.looprpc.ServerPushKeyReq.prototype.getProtocolVersion = function() { + return /** @type {!proto.looprpc.ProtocolVersion} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.looprpc.ProtocolVersion} value */ +proto.looprpc.ServerPushKeyReq.prototype.setProtocolVersion = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes swap_hash = 2; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerPushKeyReq.prototype.getSwapHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes swap_hash = 2; + * This is a type-conversion wrapper around `getSwapHash()` + * @return {string} + */ +proto.looprpc.ServerPushKeyReq.prototype.getSwapHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSwapHash())); +}; + + +/** + * optional bytes swap_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSwapHash()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerPushKeyReq.prototype.getSwapHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSwapHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.looprpc.ServerPushKeyReq.prototype.setSwapHash = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes internal_privkey = 3; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerPushKeyReq.prototype.getInternalPrivkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes internal_privkey = 3; + * This is a type-conversion wrapper around `getInternalPrivkey()` + * @return {string} + */ +proto.looprpc.ServerPushKeyReq.prototype.getInternalPrivkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getInternalPrivkey())); +}; + + +/** + * optional bytes internal_privkey = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getInternalPrivkey()` + * @return {!Uint8Array} + */ +proto.looprpc.ServerPushKeyReq.prototype.getInternalPrivkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getInternalPrivkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.looprpc.ServerPushKeyReq.prototype.setInternalPrivkey = function(value) { + jspb.Message.setProto3BytesField(this, 3, 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.looprpc.ServerPushKeyRes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerPushKeyRes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.looprpc.ServerPushKeyRes.displayName = 'proto.looprpc.ServerPushKeyRes'; +} + + +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.looprpc.ServerPushKeyRes.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerPushKeyRes.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.looprpc.ServerPushKeyRes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerPushKeyRes.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.looprpc.ServerPushKeyRes} + */ +proto.looprpc.ServerPushKeyRes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerPushKeyRes; + return proto.looprpc.ServerPushKeyRes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerPushKeyRes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerPushKeyRes} + */ +proto.looprpc.ServerPushKeyRes.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.looprpc.ServerPushKeyRes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerPushKeyRes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.looprpc.ServerPushKeyRes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerPushKeyRes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + /** * @enum {number} */ @@ -6581,7 +7045,8 @@ proto.looprpc.ProtocolVersion = { LOOP_OUT_CANCEL: 7, PROBE: 8, ROUTING_PLUGIN: 9, - HTLC_V3: 10 + HTLC_V3: 10, + MUSIG2: 11 }; /** diff --git a/app/src/types/generated/swapserverrpc/server_pb_service.d.ts b/app/src/types/generated/swapserverrpc/server_pb_service.d.ts index a9f3db59..d6ffba87 100644 --- a/app/src/types/generated/swapserverrpc/server_pb_service.d.ts +++ b/app/src/types/generated/swapserverrpc/server_pb_service.d.ts @@ -130,6 +130,15 @@ type SwapServerMuSig2SignSweep = { readonly responseType: typeof swapserverrpc_server_pb.MuSig2SignSweepRes; }; +type SwapServerPushKey = { + readonly methodName: string; + readonly service: typeof SwapServer; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof swapserverrpc_server_pb.ServerPushKeyReq; + readonly responseType: typeof swapserverrpc_server_pb.ServerPushKeyRes; +}; + export class SwapServer { static readonly serviceName: string; static readonly LoopOutTerms: SwapServerLoopOutTerms; @@ -146,6 +155,7 @@ export class SwapServer { static readonly RecommendRoutingPlugin: SwapServerRecommendRoutingPlugin; static readonly ReportRoutingResult: SwapServerReportRoutingResult; static readonly MuSig2SignSweep: SwapServerMuSig2SignSweep; + static readonly PushKey: SwapServerPushKey; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -290,5 +300,14 @@ export class SwapServerClient { requestMessage: swapserverrpc_server_pb.MuSig2SignSweepReq, callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.MuSig2SignSweepRes|null) => void ): UnaryResponse; + pushKey( + requestMessage: swapserverrpc_server_pb.ServerPushKeyReq, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerPushKeyRes|null) => void + ): UnaryResponse; + pushKey( + requestMessage: swapserverrpc_server_pb.ServerPushKeyReq, + callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerPushKeyRes|null) => void + ): UnaryResponse; } diff --git a/app/src/types/generated/swapserverrpc/server_pb_service.js b/app/src/types/generated/swapserverrpc/server_pb_service.js index cb5bce1d..2ef13370 100644 --- a/app/src/types/generated/swapserverrpc/server_pb_service.js +++ b/app/src/types/generated/swapserverrpc/server_pb_service.js @@ -136,6 +136,15 @@ SwapServer.MuSig2SignSweep = { responseType: swapserverrpc_server_pb.MuSig2SignSweepRes }; +SwapServer.PushKey = { + methodName: "PushKey", + service: SwapServer, + requestStream: false, + responseStream: false, + requestType: swapserverrpc_server_pb.ServerPushKeyReq, + responseType: swapserverrpc_server_pb.ServerPushKeyRes +}; + exports.SwapServer = SwapServer; function SwapServerClient(serviceHost, options) { @@ -593,5 +602,36 @@ SwapServerClient.prototype.muSig2SignSweep = function muSig2SignSweep(requestMes }; }; +SwapServerClient.prototype.pushKey = function pushKey(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(SwapServer.PushKey, { + 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.SwapServerClient = SwapServerClient; diff --git a/go.mod b/go.mod index 3dbeaf3d..81efbb79 100644 --- a/go.mod +++ b/go.mod @@ -12,13 +12,13 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 github.com/improbable-eng/grpc-web v0.12.0 github.com/jessevdk/go-flags v1.4.0 - github.com/lightninglabs/aperture v0.1.19-beta.0.20230227124349-b952e4ee6ff4 + github.com/lightninglabs/aperture v0.1.20-beta github.com/lightninglabs/faraday v0.2.9-alpha.0.20230307084535-e9359999b5da github.com/lightninglabs/lightning-node-connect v0.1.12-alpha github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.1 - github.com/lightninglabs/lndclient v0.16.0-9 - github.com/lightninglabs/loop v0.21.0-beta.0.20230307115451-ec4f2507535c - github.com/lightninglabs/loop/swapserverrpc v1.0.3 + github.com/lightninglabs/lndclient v0.16.0-10 + github.com/lightninglabs/loop v0.22.0-beta + github.com/lightninglabs/loop/swapserverrpc v1.0.4 github.com/lightninglabs/pool v0.6.2-beta github.com/lightninglabs/pool/auctioneerrpc v1.1.0 github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display diff --git a/go.sum b/go.sum index 3086679b..92fedf85 100644 --- a/go.sum +++ b/go.sum @@ -524,8 +524,8 @@ github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightninglabs/aperture v0.1.18-beta/go.mod h1:lDjRKhndRH0CzZQ2m8dWODdqp/ejEW7esb2u2nlvrw4= -github.com/lightninglabs/aperture v0.1.19-beta.0.20230227124349-b952e4ee6ff4 h1:1KwmHQWnssx7yk0HzOUMcAkwIdVerEozmvq3B5luO4Y= -github.com/lightninglabs/aperture v0.1.19-beta.0.20230227124349-b952e4ee6ff4/go.mod h1:q6FqmxkrHxQgmbSHW5CMxQlhIMiXxqVogBZYmC0OmhQ= +github.com/lightninglabs/aperture v0.1.20-beta h1:zMcYtzhaC+LsGpkS4Xkt6Qv2YeMHSL6wXQA0cydER1U= +github.com/lightninglabs/aperture v0.1.20-beta/go.mod h1:81OL9AHa8Wjm1HzRqTa6jkcafyaxJAsHZDIG5jj6RlU= github.com/lightninglabs/faraday v0.2.9-alpha.0.20230307084535-e9359999b5da h1:7DgyJvFgCbgQsPEHsNShAfW+umjVvOqEp6n0IgQXpQ0= github.com/lightninglabs/faraday v0.2.9-alpha.0.20230307084535-e9359999b5da/go.mod h1:uJ6dqaUatwiOcyek6SzJ/Rt6LZI5BQIopXVZr3L+xvU= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc= @@ -535,12 +535,12 @@ github.com/lightninglabs/lightning-node-connect v0.1.12-alpha/go.mod h1:dgyhE+O4 github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2XZwcfE4xoS5AILqP1mj7kqnhbBSxW9BDxY= github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4= github.com/lightninglabs/lndclient v0.15.0-0/go.mod h1:ORS/YFe9hAXlzN/Uj+gvTmrnXEml6yD6dWwzCjpTJyQ= -github.com/lightninglabs/lndclient v0.16.0-9 h1:rqvmEgH/1yILUwkB1Kg60EcBEFUWfV5iFJ1llpFfjoM= -github.com/lightninglabs/lndclient v0.16.0-9/go.mod h1:2lh5FD1Xtu+k5Pl+iMzSklFsjN+7QmcoJ5GAh+nzj5g= -github.com/lightninglabs/loop v0.21.0-beta.0.20230307115451-ec4f2507535c h1:VeKuYugjdBoj6AcvnwCYpwZLtZyjrXBCldeY1mSIvf0= -github.com/lightninglabs/loop v0.21.0-beta.0.20230307115451-ec4f2507535c/go.mod h1:HAYzQBOlfQlBNDccZvw5MWBO6FDzdGgKoZZJ0souUP0= -github.com/lightninglabs/loop/swapserverrpc v1.0.3 h1:Uslz7QZ2MWKo00JrEumCqDs9S4hR6Is4cA2GsoTbLd8= -github.com/lightninglabs/loop/swapserverrpc v1.0.3/go.mod h1:imy1/sqnb70EEyBKMo4pHwwLBPW8uYahWZ8s+1Xcq1o= +github.com/lightninglabs/lndclient v0.16.0-10 h1:cMBJNfssBQtpgYIu23QLP/qw0ijiT5SBZffnXz8zjJk= +github.com/lightninglabs/lndclient v0.16.0-10/go.mod h1:mqY0znSNa+M40HZowwKfno29RyZnmxoqo++BlYP82EY= +github.com/lightninglabs/loop v0.22.0-beta h1:IrqBcUqD2pxUn8QJDkGxgSIy2IFpYACAL3HbCrsb1x0= +github.com/lightninglabs/loop v0.22.0-beta/go.mod h1:l0YzugujgGkVPVWXwYh6TsN423OALg9fPF/203dwez4= +github.com/lightninglabs/loop/swapserverrpc v1.0.4 h1:cEX+mt7xmQlEbmuQ52vOBT7l+a471v94ofdJbB6MmXs= +github.com/lightninglabs/loop/swapserverrpc v1.0.4/go.mod h1:imy1/sqnb70EEyBKMo4pHwwLBPW8uYahWZ8s+1Xcq1o= github.com/lightninglabs/neutrino v0.13.2/go.mod h1:Cv/v8oHiPhuGiGvGgO+rIMhwCwEdsQFu6as840i2afw= github.com/lightninglabs/neutrino v0.14.1/go.mod h1:SV9ccrw2m6t6UvJX8xB//W0Dv+LEwMTbjg4V/Fb5KwU= github.com/lightninglabs/neutrino v0.15.0 h1:yr3uz36fLAq8hyM0TRUVlef1TRNoWAqpmmNlVtKUDtI= diff --git a/proto/loop.proto b/proto/loop.proto index 600ccc27..5a32a9b6 100644 --- a/proto/loop.proto +++ b/proto/loop.proto @@ -823,12 +823,13 @@ message LiquidityParameters { uint64 autoloop_budget_sat = 11 [jstype = JS_STRING]; /* - The start time for autoloop budget, expressed as a unix timestamp in - seconds. If this value is 0, the budget will be applied for all - automatically dispatched swaps. Swaps that were completed before this date - will not be included in budget calculations. + Deprecated, use autoloop_budget_refresh_period_sec. The start time for + autoloop budget, expressed as a unix timestamp in seconds. If this value is + 0, the budget will be applied for all automatically dispatched swaps. Swaps + that were completed before this date will not be included in budget + calculations. */ - uint64 autoloop_budget_start_sec = 12 [jstype = JS_STRING]; + uint64 autoloop_budget_start_sec = 12 [deprecated = true, jstype = JS_STRING]; /* The maximum number of automatically dispatched swaps that we allow to be in @@ -860,6 +861,18 @@ message LiquidityParameters { order to revert to default behavior. */ string autoloop_dest_address = 18; + + /* + The period over which the autoloop budget is refreshed, expressed in + seconds. + */ + uint64 autoloop_budget_refresh_period_sec = 19 [jstype = JS_STRING]; + + /* + The time at which the autoloop budget was last refreshed, expressed as a + UNIX timestamp in seconds. + */ + uint64 autoloop_budget_last_refresh = 20 [jstype = JS_STRING]; } enum LiquidityRuleType { diff --git a/proto/swapserverrpc/server.proto b/proto/swapserverrpc/server.proto index 2ab3d78e..cf66547c 100644 --- a/proto/swapserverrpc/server.proto +++ b/proto/swapserverrpc/server.proto @@ -45,6 +45,8 @@ service SwapServer { returns (ReportRoutingResultRes); rpc MuSig2SignSweep (MuSig2SignSweepReq) returns (MuSig2SignSweepRes); + + rpc PushKey (ServerPushKeyReq) returns (ServerPushKeyRes); } /** @@ -97,6 +99,9 @@ enum ProtocolVersion { // The client will use the new v3 (taproot) HTLC scripts. HTLC_V3 = 10; + + // Enables MuSig2 signature scheme for swaps. + MUSIG2 = 11; } message ServerLoopOutRequest { @@ -196,14 +201,21 @@ message ServerLoopOutTerms { message ServerLoopInRequest { bytes sender_key = 1; + + bytes sender_internal_pubkey = 9; + bytes swap_hash = 2; + uint64 amt = 3 [jstype = JS_STRING]; + string swap_invoice = 4; + bytes last_hop = 5; /// The protocol version that the client adheres to. ProtocolVersion protocol_version = 6; + // An invoice that can be used for the purpose of probing. string probe_invoice = 7; // The user agent string that identifies the software running on the user's @@ -218,6 +230,9 @@ message ServerLoopInRequest { message ServerLoopInResponse { bytes receiver_key = 1; + + bytes receiver_internal_pubkey = 9; + int32 expiry = 2; // A human-readable message from the loop server. @@ -458,7 +473,7 @@ message CancelLoopOutSwapResponse { } message ServerProbeRequest { - /// The protocol version that the client adheres to. + // The protocol version that the client adheres to. ProtocolVersion protocol_version = 1; // The probe amount. @@ -470,9 +485,7 @@ message ServerProbeRequest { // Optional last hop to use when probing the client. bytes last_hop = 4; - /* - Optional route hints to reach the destination through private channels. - */ + // Optional route hints to reach the destination through private channels. repeated RouteHint route_hints = 5; } @@ -555,3 +568,17 @@ message MuSig2SignSweepRes { // The partial signature of the server for the requested sighash. bytes partial_signature = 2; } + +message ServerPushKeyReq { + // The protocol version that the client adheres to. + ProtocolVersion protocol_version = 1; + + // The swap hash. + bytes swap_hash = 2; + + // The client’s private key used in the HTLC’s aggregated internal key. + bytes internal_privkey = 3; +} + +message ServerPushKeyRes { +}