diff --git a/app/src/types/generated/loop_pb.d.ts b/app/src/types/generated/loop_pb.d.ts index f996883d..4a45b17f 100644 --- a/app/src/types/generated/loop_pb.d.ts +++ b/app/src/types/generated/loop_pb.d.ts @@ -569,6 +569,9 @@ export class QuoteRequest extends jspb.Message { getAutoSelectDeposits(): boolean; setAutoSelectDeposits(value: boolean): void; + getFast(): boolean; + setFast(value: boolean): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): QuoteRequest.AsObject; static toObject(includeInstance: boolean, msg: QuoteRequest): QuoteRequest.AsObject; @@ -591,6 +594,7 @@ export namespace QuoteRequest { depositOutpointsList: Array, assetInfo?: AssetLoopOutRequest.AsObject, autoSelectDeposits: boolean, + fast: boolean, } } @@ -607,6 +611,9 @@ export class InQuoteResponse extends jspb.Message { getConfTarget(): number; setConfTarget(value: number): void; + getQuotedAmt(): string; + setQuotedAmt(value: string): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InQuoteResponse.AsObject; static toObject(includeInstance: boolean, msg: InQuoteResponse): InQuoteResponse.AsObject; @@ -623,6 +630,7 @@ export namespace InQuoteResponse { htlcPublishFeeSat: string, cltvDelta: number, confTarget: number, + quotedAmt: string, } } @@ -2179,6 +2187,9 @@ export class StaticAddressLoopInRequest extends jspb.Message { getAmount(): string; setAmount(value: string): void; + getFast(): boolean; + setFast(value: boolean): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): StaticAddressLoopInRequest.AsObject; static toObject(includeInstance: boolean, msg: StaticAddressLoopInRequest): StaticAddressLoopInRequest.AsObject; @@ -2200,6 +2211,7 @@ export namespace StaticAddressLoopInRequest { pb_private: boolean, paymentTimeoutSeconds: number, amount: string, + fast: boolean, } } @@ -2239,6 +2251,20 @@ export class StaticAddressLoopInResponse extends jspb.Message { getPaymentTimeoutSeconds(): number; setPaymentTimeoutSeconds(value: number): void; + clearUsedDepositsList(): void; + getUsedDepositsList(): Array; + setUsedDepositsList(value: Array): void; + addUsedDeposits(value?: Deposit, index?: number): Deposit; + + getSwapAmount(): string; + setSwapAmount(value: string): void; + + getChange(): string; + setChange(value: string): void; + + getFast(): boolean; + setFast(value: boolean): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): StaticAddressLoopInResponse.AsObject; static toObject(includeInstance: boolean, msg: StaticAddressLoopInResponse): StaticAddressLoopInResponse.AsObject; @@ -2262,6 +2288,10 @@ export namespace StaticAddressLoopInResponse { label: string, initiator: string, paymentTimeoutSeconds: number, + usedDepositsList: Array, + swapAmount: string, + change: string, + fast: boolean, } } diff --git a/app/src/types/generated/loop_pb.js b/app/src/types/generated/loop_pb.js index 058bb6d3..7c73a390 100644 --- a/app/src/types/generated/loop_pb.js +++ b/app/src/types/generated/loop_pb.js @@ -1503,7 +1503,7 @@ if (goog.DEBUG && !COMPILED) { * @constructor */ proto.looprpc.StaticAddressLoopInResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); + jspb.Message.initialize(this, opt_data, 0, -1, proto.looprpc.StaticAddressLoopInResponse.repeatedFields_, null); }; goog.inherits(proto.looprpc.StaticAddressLoopInResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { @@ -5462,7 +5462,8 @@ proto.looprpc.QuoteRequest.toObject = function(includeInstance, msg) { pb_private: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), depositOutpointsList: (f = jspb.Message.getRepeatedField(msg, 8)) == null ? undefined : f, assetInfo: (f = msg.getAssetInfo()) && proto.looprpc.AssetLoopOutRequest.toObject(includeInstance, f), - autoSelectDeposits: jspb.Message.getBooleanFieldWithDefault(msg, 10, false) + autoSelectDeposits: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + fast: jspb.Message.getBooleanFieldWithDefault(msg, 11, false) }; if (includeInstance) { @@ -5541,6 +5542,10 @@ proto.looprpc.QuoteRequest.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {boolean} */ (reader.readBool()); msg.setAutoSelectDeposits(value); break; + case 11: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setFast(value); + break; default: reader.skipField(); break; @@ -5642,6 +5647,13 @@ proto.looprpc.QuoteRequest.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getFast(); + if (f) { + writer.writeBool( + 11, + f + ); + } }; @@ -5907,6 +5919,24 @@ proto.looprpc.QuoteRequest.prototype.setAutoSelectDeposits = function(value) { }; +/** + * optional bool fast = 11; + * @return {boolean} + */ +proto.looprpc.QuoteRequest.prototype.getFast = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.looprpc.QuoteRequest} returns this + */ +proto.looprpc.QuoteRequest.prototype.setFast = function(value) { + return jspb.Message.setProto3BooleanField(this, 11, value); +}; + + @@ -5942,7 +5972,8 @@ proto.looprpc.InQuoteResponse.toObject = function(includeInstance, msg) { swapFeeSat: jspb.Message.getFieldWithDefault(msg, 1, "0"), htlcPublishFeeSat: jspb.Message.getFieldWithDefault(msg, 3, "0"), cltvDelta: jspb.Message.getFieldWithDefault(msg, 5, 0), - confTarget: jspb.Message.getFieldWithDefault(msg, 6, 0) + confTarget: jspb.Message.getFieldWithDefault(msg, 6, 0), + quotedAmt: jspb.Message.getFieldWithDefault(msg, 7, "0") }; if (includeInstance) { @@ -5995,6 +6026,10 @@ proto.looprpc.InQuoteResponse.deserializeBinaryFromReader = function(msg, reader var value = /** @type {number} */ (reader.readInt32()); msg.setConfTarget(value); break; + case 7: + var value = /** @type {string} */ (reader.readInt64String()); + msg.setQuotedAmt(value); + break; default: reader.skipField(); break; @@ -6052,6 +6087,13 @@ proto.looprpc.InQuoteResponse.serializeBinaryToWriter = function(message, writer f ); } + f = message.getQuotedAmt(); + if (parseInt(f, 10) !== 0) { + writer.writeInt64String( + 7, + f + ); + } }; @@ -6127,6 +6169,24 @@ proto.looprpc.InQuoteResponse.prototype.setConfTarget = function(value) { }; +/** + * optional int64 quoted_amt = 7; + * @return {string} + */ +proto.looprpc.InQuoteResponse.prototype.getQuotedAmt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.InQuoteResponse} returns this + */ +proto.looprpc.InQuoteResponse.prototype.setQuotedAmt = function(value) { + return jspb.Message.setProto3StringIntField(this, 7, value); +}; + + @@ -17033,7 +17093,8 @@ proto.looprpc.StaticAddressLoopInRequest.toObject = function(includeInstance, ms swapserverrpc_common_pb.RouteHint.toObject, includeInstance), pb_private: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), paymentTimeoutSeconds: jspb.Message.getFieldWithDefault(msg, 8, 0), - amount: jspb.Message.getFieldWithDefault(msg, 9, "0") + amount: jspb.Message.getFieldWithDefault(msg, 9, "0"), + fast: jspb.Message.getBooleanFieldWithDefault(msg, 10, false) }; if (includeInstance) { @@ -17107,6 +17168,10 @@ proto.looprpc.StaticAddressLoopInRequest.deserializeBinaryFromReader = function( var value = /** @type {string} */ (reader.readInt64String()); msg.setAmount(value); break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setFast(value); + break; default: reader.skipField(); break; @@ -17200,6 +17265,13 @@ proto.looprpc.StaticAddressLoopInRequest.serializeBinaryToWriter = function(mess f ); } + f = message.getFast(); + if (f) { + writer.writeBool( + 10, + f + ); + } }; @@ -17428,6 +17500,31 @@ proto.looprpc.StaticAddressLoopInRequest.prototype.setAmount = function(value) { }; +/** + * optional bool fast = 10; + * @return {boolean} + */ +proto.looprpc.StaticAddressLoopInRequest.prototype.getFast = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.looprpc.StaticAddressLoopInRequest} returns this + */ +proto.looprpc.StaticAddressLoopInRequest.prototype.setFast = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.looprpc.StaticAddressLoopInResponse.repeatedFields_ = [12]; @@ -17470,7 +17567,12 @@ proto.looprpc.StaticAddressLoopInResponse.toObject = function(includeInstance, m protocolVersion: jspb.Message.getFieldWithDefault(msg, 8, ""), label: jspb.Message.getFieldWithDefault(msg, 9, ""), initiator: jspb.Message.getFieldWithDefault(msg, 10, ""), - paymentTimeoutSeconds: jspb.Message.getFieldWithDefault(msg, 11, 0) + paymentTimeoutSeconds: jspb.Message.getFieldWithDefault(msg, 11, 0), + usedDepositsList: jspb.Message.toObjectList(msg.getUsedDepositsList(), + proto.looprpc.Deposit.toObject, includeInstance), + swapAmount: jspb.Message.getFieldWithDefault(msg, 13, "0"), + change: jspb.Message.getFieldWithDefault(msg, 14, "0"), + fast: jspb.Message.getBooleanFieldWithDefault(msg, 15, false) }; if (includeInstance) { @@ -17551,6 +17653,23 @@ proto.looprpc.StaticAddressLoopInResponse.deserializeBinaryFromReader = function var value = /** @type {number} */ (reader.readUint32()); msg.setPaymentTimeoutSeconds(value); break; + case 12: + var value = new proto.looprpc.Deposit; + reader.readMessage(value,proto.looprpc.Deposit.deserializeBinaryFromReader); + msg.addUsedDeposits(value); + break; + case 13: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setSwapAmount(value); + break; + case 14: + var value = /** @type {string} */ (reader.readInt64String()); + msg.setChange(value); + break; + case 15: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setFast(value); + break; default: reader.skipField(); break; @@ -17657,6 +17776,35 @@ proto.looprpc.StaticAddressLoopInResponse.serializeBinaryToWriter = function(mes f ); } + f = message.getUsedDepositsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 12, + f, + proto.looprpc.Deposit.serializeBinaryToWriter + ); + } + f = message.getSwapAmount(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 13, + f + ); + } + f = message.getChange(); + if (parseInt(f, 10) !== 0) { + writer.writeInt64String( + 14, + f + ); + } + f = message.getFast(); + if (f) { + writer.writeBool( + 15, + f + ); + } }; @@ -17882,6 +18030,98 @@ proto.looprpc.StaticAddressLoopInResponse.prototype.setPaymentTimeoutSeconds = f }; +/** + * repeated Deposit used_deposits = 12; + * @return {!Array} + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.getUsedDepositsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.looprpc.Deposit, 12)); +}; + + +/** + * @param {!Array} value + * @return {!proto.looprpc.StaticAddressLoopInResponse} returns this +*/ +proto.looprpc.StaticAddressLoopInResponse.prototype.setUsedDepositsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 12, value); +}; + + +/** + * @param {!proto.looprpc.Deposit=} opt_value + * @param {number=} opt_index + * @return {!proto.looprpc.Deposit} + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.addUsedDeposits = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.looprpc.Deposit, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.looprpc.StaticAddressLoopInResponse} returns this + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.clearUsedDepositsList = function() { + return this.setUsedDepositsList([]); +}; + + +/** + * optional uint64 swap_amount = 13; + * @return {string} + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.getSwapAmount = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.StaticAddressLoopInResponse} returns this + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.setSwapAmount = function(value) { + return jspb.Message.setProto3StringIntField(this, 13, value); +}; + + +/** + * optional int64 change = 14; + * @return {string} + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.getChange = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.looprpc.StaticAddressLoopInResponse} returns this + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.setChange = function(value) { + return jspb.Message.setProto3StringIntField(this, 14, value); +}; + + +/** + * optional bool fast = 15; + * @return {boolean} + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.getFast = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 15, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.looprpc.StaticAddressLoopInResponse} returns this + */ +proto.looprpc.StaticAddressLoopInResponse.prototype.setFast = function(value) { + return jspb.Message.setProto3BooleanField(this, 15, value); +}; + + diff --git a/app/src/types/generated/swapserverrpc/server_pb.d.ts b/app/src/types/generated/swapserverrpc/server_pb.d.ts index 00cc4dfc..63bff333 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.d.ts +++ b/app/src/types/generated/swapserverrpc/server_pb.d.ts @@ -351,6 +351,9 @@ export class ServerLoopInQuoteRequest extends jspb.Message { getNumStaticAddressDeposits(): number; setNumStaticAddressDeposits(value: number): void; + getFast(): boolean; + setFast(value: boolean): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ServerLoopInQuoteRequest.AsObject; static toObject(includeInstance: boolean, msg: ServerLoopInQuoteRequest): ServerLoopInQuoteRequest.AsObject; @@ -370,6 +373,7 @@ export namespace ServerLoopInQuoteRequest { protocolVersion: ProtocolVersionMap[keyof ProtocolVersionMap], userAgent: string, numStaticAddressDeposits: number, + fast: boolean, } } @@ -1052,6 +1056,9 @@ export namespace FetchL402Response { } export class SubscribeNotificationsRequest extends jspb.Message { + getVersion(): SubscribeNotificationsRequest.ListenerVersionMap[keyof SubscribeNotificationsRequest.ListenerVersionMap]; + setVersion(value: SubscribeNotificationsRequest.ListenerVersionMap[keyof SubscribeNotificationsRequest.ListenerVersionMap]): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SubscribeNotificationsRequest.AsObject; static toObject(includeInstance: boolean, msg: SubscribeNotificationsRequest): SubscribeNotificationsRequest.AsObject; @@ -1064,7 +1071,15 @@ export class SubscribeNotificationsRequest extends jspb.Message { export namespace SubscribeNotificationsRequest { export type AsObject = { + version: SubscribeNotificationsRequest.ListenerVersionMap[keyof SubscribeNotificationsRequest.ListenerVersionMap], } + + export interface ListenerVersionMap { + LEGACY: 0; + V1: 1; + } + + export const ListenerVersion: ListenerVersionMap; } export class SubscribeNotificationsResponse extends jspb.Message { @@ -1078,6 +1093,11 @@ export class SubscribeNotificationsResponse extends jspb.Message { getStaticLoopInSweep(): ServerStaticLoopInSweepNotification | undefined; setStaticLoopInSweep(value?: ServerStaticLoopInSweepNotification): void; + hasUnfinishedSwap(): boolean; + clearUnfinishedSwap(): void; + getUnfinishedSwap(): ServerUnfinishedSwapNotification | undefined; + setUnfinishedSwap(value?: ServerUnfinishedSwapNotification): void; + getNotificationCase(): SubscribeNotificationsResponse.NotificationCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SubscribeNotificationsResponse.AsObject; @@ -1093,12 +1113,14 @@ export namespace SubscribeNotificationsResponse { export type AsObject = { reservationNotification?: swapserverrpc_reservation_pb.ServerReservationNotification.AsObject, staticLoopInSweep?: ServerStaticLoopInSweepNotification.AsObject, + unfinishedSwap?: ServerUnfinishedSwapNotification.AsObject, } export enum NotificationCase { NOTIFICATION_NOT_SET = 0, RESERVATION_NOTIFICATION = 1, STATIC_LOOP_IN_SWEEP = 2, + UNFINISHED_SWAP = 3, } } @@ -1139,6 +1161,32 @@ export namespace ServerStaticLoopInSweepNotification { } } +export class ServerUnfinishedSwapNotification extends jspb.Message { + getSwapHash(): Uint8Array | string; + getSwapHash_asU8(): Uint8Array; + getSwapHash_asB64(): string; + setSwapHash(value: Uint8Array | string): void; + + getIsLoopIn(): boolean; + setIsLoopIn(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerUnfinishedSwapNotification.AsObject; + static toObject(includeInstance: boolean, msg: ServerUnfinishedSwapNotification): ServerUnfinishedSwapNotification.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerUnfinishedSwapNotification, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerUnfinishedSwapNotification; + static deserializeBinaryFromReader(message: ServerUnfinishedSwapNotification, reader: jspb.BinaryReader): ServerUnfinishedSwapNotification; +} + +export namespace ServerUnfinishedSwapNotification { + export type AsObject = { + swapHash: Uint8Array | string, + isLoopIn: boolean, + } +} + export interface ProtocolVersionMap { LEGACY: 0; MULTI_LOOP_OUT: 1; diff --git a/app/src/types/generated/swapserverrpc/server_pb.js b/app/src/types/generated/swapserverrpc/server_pb.js index 84a2e562..f984720a 100644 --- a/app/src/types/generated/swapserverrpc/server_pb.js +++ b/app/src/types/generated/swapserverrpc/server_pb.js @@ -66,9 +66,11 @@ goog.exportSymbol('proto.looprpc.ServerPushKeyReq', null, global); goog.exportSymbol('proto.looprpc.ServerPushKeyRes', null, global); goog.exportSymbol('proto.looprpc.ServerStaticLoopInSweepNotification', null, global); goog.exportSymbol('proto.looprpc.ServerSwapState', null, global); +goog.exportSymbol('proto.looprpc.ServerUnfinishedSwapNotification', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopInUpdatesResponse', null, global); goog.exportSymbol('proto.looprpc.SubscribeLoopOutUpdatesResponse', null, global); goog.exportSymbol('proto.looprpc.SubscribeNotificationsRequest', null, global); +goog.exportSymbol('proto.looprpc.SubscribeNotificationsRequest.ListenerVersion', null, global); goog.exportSymbol('proto.looprpc.SubscribeNotificationsResponse', null, global); goog.exportSymbol('proto.looprpc.SubscribeNotificationsResponse.NotificationCase', null, global); goog.exportSymbol('proto.looprpc.SubscribeUpdatesRequest', null, global); @@ -849,6 +851,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.looprpc.ServerStaticLoopInSweepNotification.displayName = 'proto.looprpc.ServerStaticLoopInSweepNotification'; } +/** + * 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.ServerUnfinishedSwapNotification = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.looprpc.ServerUnfinishedSwapNotification, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.looprpc.ServerUnfinishedSwapNotification.displayName = 'proto.looprpc.ServerUnfinishedSwapNotification'; +} @@ -3201,7 +3224,8 @@ proto.looprpc.ServerLoopInQuoteRequest.toObject = function(includeInstance, msg) swapserverrpc_common_pb.RouteHint.toObject, includeInstance), protocolVersion: jspb.Message.getFieldWithDefault(msg, 2, 0), userAgent: jspb.Message.getFieldWithDefault(msg, 6, ""), - numStaticAddressDeposits: jspb.Message.getFieldWithDefault(msg, 7, 0) + numStaticAddressDeposits: jspb.Message.getFieldWithDefault(msg, 7, 0), + fast: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) }; if (includeInstance) { @@ -3267,6 +3291,10 @@ proto.looprpc.ServerLoopInQuoteRequest.deserializeBinaryFromReader = function(ms var value = /** @type {number} */ (reader.readUint32()); msg.setNumStaticAddressDeposits(value); break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setFast(value); + break; default: reader.skipField(); break; @@ -3346,6 +3374,13 @@ proto.looprpc.ServerLoopInQuoteRequest.serializeBinaryToWriter = function(messag f ); } + f = message.getFast(); + if (f) { + writer.writeBool( + 8, + f + ); + } }; @@ -3543,6 +3578,24 @@ proto.looprpc.ServerLoopInQuoteRequest.prototype.setNumStaticAddressDeposits = f }; +/** + * optional bool fast = 8; + * @return {boolean} + */ +proto.looprpc.ServerLoopInQuoteRequest.prototype.getFast = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.looprpc.ServerLoopInQuoteRequest} returns this + */ +proto.looprpc.ServerLoopInQuoteRequest.prototype.setFast = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + @@ -8378,7 +8431,7 @@ proto.looprpc.SubscribeNotificationsRequest.prototype.toObject = function(opt_in */ proto.looprpc.SubscribeNotificationsRequest.toObject = function(includeInstance, msg) { var f, obj = { - + version: jspb.Message.getFieldWithDefault(msg, 1, 0) }; if (includeInstance) { @@ -8415,6 +8468,10 @@ proto.looprpc.SubscribeNotificationsRequest.deserializeBinaryFromReader = functi } var field = reader.getFieldNumber(); switch (field) { + case 1: + var value = /** @type {!proto.looprpc.SubscribeNotificationsRequest.ListenerVersion} */ (reader.readEnum()); + msg.setVersion(value); + break; default: reader.skipField(); break; @@ -8444,6 +8501,39 @@ proto.looprpc.SubscribeNotificationsRequest.prototype.serializeBinary = function */ proto.looprpc.SubscribeNotificationsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getVersion(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.looprpc.SubscribeNotificationsRequest.ListenerVersion = { + LEGACY: 0, + V1: 1 +}; + +/** + * optional ListenerVersion version = 1; + * @return {!proto.looprpc.SubscribeNotificationsRequest.ListenerVersion} + */ +proto.looprpc.SubscribeNotificationsRequest.prototype.getVersion = function() { + return /** @type {!proto.looprpc.SubscribeNotificationsRequest.ListenerVersion} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.looprpc.SubscribeNotificationsRequest.ListenerVersion} value + * @return {!proto.looprpc.SubscribeNotificationsRequest} returns this + */ +proto.looprpc.SubscribeNotificationsRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); }; @@ -8456,7 +8546,7 @@ proto.looprpc.SubscribeNotificationsRequest.serializeBinaryToWriter = function(m * @private {!Array>} * @const */ -proto.looprpc.SubscribeNotificationsResponse.oneofGroups_ = [[1,2]]; +proto.looprpc.SubscribeNotificationsResponse.oneofGroups_ = [[1,2,3]]; /** * @enum {number} @@ -8464,7 +8554,8 @@ proto.looprpc.SubscribeNotificationsResponse.oneofGroups_ = [[1,2]]; proto.looprpc.SubscribeNotificationsResponse.NotificationCase = { NOTIFICATION_NOT_SET: 0, RESERVATION_NOTIFICATION: 1, - STATIC_LOOP_IN_SWEEP: 2 + STATIC_LOOP_IN_SWEEP: 2, + UNFINISHED_SWAP: 3 }; /** @@ -8506,7 +8597,8 @@ proto.looprpc.SubscribeNotificationsResponse.prototype.toObject = function(opt_i proto.looprpc.SubscribeNotificationsResponse.toObject = function(includeInstance, msg) { var f, obj = { reservationNotification: (f = msg.getReservationNotification()) && swapserverrpc_reservation_pb.ServerReservationNotification.toObject(includeInstance, f), - staticLoopInSweep: (f = msg.getStaticLoopInSweep()) && proto.looprpc.ServerStaticLoopInSweepNotification.toObject(includeInstance, f) + staticLoopInSweep: (f = msg.getStaticLoopInSweep()) && proto.looprpc.ServerStaticLoopInSweepNotification.toObject(includeInstance, f), + unfinishedSwap: (f = msg.getUnfinishedSwap()) && proto.looprpc.ServerUnfinishedSwapNotification.toObject(includeInstance, f) }; if (includeInstance) { @@ -8553,6 +8645,11 @@ proto.looprpc.SubscribeNotificationsResponse.deserializeBinaryFromReader = funct reader.readMessage(value,proto.looprpc.ServerStaticLoopInSweepNotification.deserializeBinaryFromReader); msg.setStaticLoopInSweep(value); break; + case 3: + var value = new proto.looprpc.ServerUnfinishedSwapNotification; + reader.readMessage(value,proto.looprpc.ServerUnfinishedSwapNotification.deserializeBinaryFromReader); + msg.setUnfinishedSwap(value); + break; default: reader.skipField(); break; @@ -8598,6 +8695,14 @@ proto.looprpc.SubscribeNotificationsResponse.serializeBinaryToWriter = function( proto.looprpc.ServerStaticLoopInSweepNotification.serializeBinaryToWriter ); } + f = message.getUnfinishedSwap(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.looprpc.ServerUnfinishedSwapNotification.serializeBinaryToWriter + ); + } }; @@ -8675,6 +8780,43 @@ proto.looprpc.SubscribeNotificationsResponse.prototype.hasStaticLoopInSweep = fu }; +/** + * optional ServerUnfinishedSwapNotification unfinished_swap = 3; + * @return {?proto.looprpc.ServerUnfinishedSwapNotification} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.getUnfinishedSwap = function() { + return /** @type{?proto.looprpc.ServerUnfinishedSwapNotification} */ ( + jspb.Message.getWrapperField(this, proto.looprpc.ServerUnfinishedSwapNotification, 3)); +}; + + +/** + * @param {?proto.looprpc.ServerUnfinishedSwapNotification|undefined} value + * @return {!proto.looprpc.SubscribeNotificationsResponse} returns this +*/ +proto.looprpc.SubscribeNotificationsResponse.prototype.setUnfinishedSwap = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.looprpc.SubscribeNotificationsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.looprpc.SubscribeNotificationsResponse} returns this + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.clearUnfinishedSwap = function() { + return this.setUnfinishedSwap(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.looprpc.SubscribeNotificationsResponse.prototype.hasUnfinishedSwap = function() { + return jspb.Message.getField(this, 3) != null; +}; + + /** * List of repeated fields within this message type. @@ -8977,6 +9119,190 @@ proto.looprpc.ServerStaticLoopInSweepNotification.prototype.clearPrevoutInfoList }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.toObject = function(opt_includeInstance) { + return proto.looprpc.ServerUnfinishedSwapNotification.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.looprpc.ServerUnfinishedSwapNotification} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerUnfinishedSwapNotification.toObject = function(includeInstance, msg) { + var f, obj = { + swapHash: msg.getSwapHash_asB64(), + isLoopIn: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + 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.ServerUnfinishedSwapNotification} + */ +proto.looprpc.ServerUnfinishedSwapNotification.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.looprpc.ServerUnfinishedSwapNotification; + return proto.looprpc.ServerUnfinishedSwapNotification.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.looprpc.ServerUnfinishedSwapNotification} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.looprpc.ServerUnfinishedSwapNotification} + */ +proto.looprpc.ServerUnfinishedSwapNotification.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.setSwapHash(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsLoopIn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.looprpc.ServerUnfinishedSwapNotification.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.ServerUnfinishedSwapNotification} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.looprpc.ServerUnfinishedSwapNotification.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSwapHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getIsLoopIn(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * optional bytes swap_hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.getSwapHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes swap_hash = 1; + * This is a type-conversion wrapper around `getSwapHash()` + * @return {string} + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.getSwapHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSwapHash())); +}; + + +/** + * optional bytes swap_hash = 1; + * 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.ServerUnfinishedSwapNotification.prototype.getSwapHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSwapHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.looprpc.ServerUnfinishedSwapNotification} returns this + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.setSwapHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bool is_loop_in = 2; + * @return {boolean} + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.getIsLoopIn = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.looprpc.ServerUnfinishedSwapNotification} returns this + */ +proto.looprpc.ServerUnfinishedSwapNotification.prototype.setIsLoopIn = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + /** * @enum {number} */ diff --git a/app/src/util/tests/sampleData.ts b/app/src/util/tests/sampleData.ts index 43b43e10..c8e2a8a2 100644 --- a/app/src/util/tests/sampleData.ts +++ b/app/src/util/tests/sampleData.ts @@ -403,6 +403,7 @@ export const loopInQuote: LOOP.InQuoteResponse.AsObject = { htlcPublishFeeSat: '7387', swapFeeSat: '83', confTarget: 6, + quotedAmt: '250000', }; export const loopSwapResponse: LOOP.SwapResponse.AsObject = { diff --git a/go.mod b/go.mod index 7fb5f4da..d7d76537 100644 --- a/go.mod +++ b/go.mod @@ -25,20 +25,20 @@ require ( github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.3 github.com/lightninglabs/lightning-terminal/litrpc v1.0.2 github.com/lightninglabs/lightning-terminal/perms v1.0.1 - github.com/lightninglabs/lndclient v0.20.0-1 - github.com/lightninglabs/loop v0.31.3-beta.0.20251014011913-03de0a8ed734 - github.com/lightninglabs/loop/looprpc v1.0.10-0.20251009095951-719355211f63 - github.com/lightninglabs/loop/swapserverrpc v1.0.17-0.20251009095951-719355211f63 + github.com/lightninglabs/lndclient v0.20.0-3 + github.com/lightninglabs/loop v0.31.5-beta-lnd0.20 + github.com/lightninglabs/loop/looprpc v1.0.11 + github.com/lightninglabs/loop/swapserverrpc v1.0.18 github.com/lightninglabs/pool v0.6.6-beta github.com/lightninglabs/pool/auctioneerrpc v1.1.3 github.com/lightninglabs/pool/poolrpc v1.0.1 - github.com/lightninglabs/taproot-assets v0.7.0-rc1.0.20251014100421-92189161aa7a - github.com/lightninglabs/taproot-assets/taprpc v1.0.10-0.20251014100421-92189161aa7a - github.com/lightningnetwork/lnd v0.20.0-beta.rc1 + github.com/lightninglabs/taproot-assets v0.7.0-rc2 + github.com/lightninglabs/taproot-assets/taprpc v1.0.10 + github.com/lightningnetwork/lnd v0.20.0-beta.rc2 github.com/lightningnetwork/lnd/cert v1.2.2 github.com/lightningnetwork/lnd/clock v1.1.1 github.com/lightningnetwork/lnd/fn v1.2.5 - github.com/lightningnetwork/lnd/fn/v2 v2.0.8 + github.com/lightningnetwork/lnd/fn/v2 v2.0.9 github.com/lightningnetwork/lnd/kvdb v1.4.16 github.com/lightningnetwork/lnd/sqldb v1.0.11 github.com/lightningnetwork/lnd/tlv v1.3.2 diff --git a/go.sum b/go.sum index 38107628..e0e4baf9 100644 --- a/go.sum +++ b/go.sum @@ -1154,14 +1154,14 @@ github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.3 h1:NuDp6Z+QNM github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.3/go.mod h1:bDnEKRN1u13NFBuy/C+bFLhxA5bfd3clT25y76QY0AM= github.com/lightninglabs/lightning-node-connect/mailbox v1.0.1 h1:RWmohykp3n/DTMWY8b18RNTEcLDf+KT/AZHKYdOObkM= github.com/lightninglabs/lightning-node-connect/mailbox v1.0.1/go.mod h1:NYtNexZE9gO1eOeegTxmIW9fqanl7eZ9cOrE9yewSAk= -github.com/lightninglabs/lndclient v0.20.0-1 h1:xwDoh7z3bszXc4mkMO6ksEcXhkQw9v0XHJ7fB0LKDNo= -github.com/lightninglabs/lndclient v0.20.0-1/go.mod h1:LcbsTCCd0Qw5C4zlv/YqrPY81XUVA6wN1lA/qEWIs+Y= -github.com/lightninglabs/loop v0.31.3-beta.0.20251014011913-03de0a8ed734 h1:wyZQEjOnu7oSt6a87Uwbm/GoL2/AgdW+6peJc2qmgtg= -github.com/lightninglabs/loop v0.31.3-beta.0.20251014011913-03de0a8ed734/go.mod h1:01kFhAF+K5MKB6P1mbr0dy6oOgK35cJ1WFUxetdHG2c= -github.com/lightninglabs/loop/looprpc v1.0.10-0.20251009095951-719355211f63 h1:2UV/LBK1VPmnA6MhSPXW9Tjmy3bW1FzJkKB4Oy1ULpw= -github.com/lightninglabs/loop/looprpc v1.0.10-0.20251009095951-719355211f63/go.mod h1:c7WykKQZ3PspCMVvv2kr9o4l3bgJBEBVv0SOoBOjPOw= -github.com/lightninglabs/loop/swapserverrpc v1.0.17-0.20251009095951-719355211f63 h1:BAsOCw4jj9bHUD+94b8F75NIATwr6xosS2m+4wJa59o= -github.com/lightninglabs/loop/swapserverrpc v1.0.17-0.20251009095951-719355211f63/go.mod h1:YDoUxA1eV/mbv+gXr4Ova7AFNSiIO+7xXdP7teQmMJY= +github.com/lightninglabs/lndclient v0.20.0-3 h1:hL37EJHYupIEQRSgogA6AFbFQ/6l+A+DuqJMGZ8vm8s= +github.com/lightninglabs/lndclient v0.20.0-3/go.mod h1:GMqsKYJ/CkKY2DgPJfcvvHf98qiwr4fpKir8oAN7TiI= +github.com/lightninglabs/loop v0.31.5-beta-lnd0.20 h1:IO4s9WUER1OIO8Aqam/k6mVoZnWh+loJAGt19w/I12Y= +github.com/lightninglabs/loop v0.31.5-beta-lnd0.20/go.mod h1:11ojYzxnwdHkErhV8aFHy9IfReokOoNRg/B72F5Ck4g= +github.com/lightninglabs/loop/looprpc v1.0.11 h1:YCz67k5GSm3EKMCRBfis034Pd3R0+vPPHgfNwQqjpaE= +github.com/lightninglabs/loop/looprpc v1.0.11/go.mod h1:m2B9bg8Cus1TVbXD3RffKVmGS3lpV2Zl1yu5x3wcQYk= +github.com/lightninglabs/loop/swapserverrpc v1.0.18 h1:gMZi7uU5yeNqqKyPYZHpjgiPr8mmU6DDRPYCIGdtL/A= +github.com/lightninglabs/loop/swapserverrpc v1.0.18/go.mod h1:yZqah0rhO54JN9/dk41DdRvjQCxX0RjGVVwtXOXgypE= github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2 h1:eFjp1dIB2BhhQp/THKrjLdlYuPugO9UU4kDqu91OX/Q= github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2/go.mod h1:99BKpIi6ruaaXRM1A77eqZ+FWPQ3cfRa+ZVy5bmWMaY= github.com/lightninglabs/neutrino v0.16.1 h1:5Kz4ToxncEVkpKC6fwUjXKtFKJhuxlG3sBB3MdJTJjs= @@ -1176,22 +1176,22 @@ github.com/lightninglabs/pool/poolrpc v1.0.1 h1:XbNx28TYwEj/PVsnnF9TnveVCMCYfS1v github.com/lightninglabs/pool/poolrpc v1.0.1/go.mod h1:836icifg/SBnZbiae0v3jeRRzCrT6LWo32SqCS/JiGk= github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display h1:w7FM5LH9Z6CpKxl13mS48idsu6F+cEZf0lkyiV+Dq9g= github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -github.com/lightninglabs/taproot-assets v0.7.0-rc1.0.20251014100421-92189161aa7a h1:chq0nuhADO7yjngYGtFEdVL9jJWFbfiwdlaHBsRMk04= -github.com/lightninglabs/taproot-assets v0.7.0-rc1.0.20251014100421-92189161aa7a/go.mod h1:qC9TBmn7gV+6LrDhacCe2DD0MnMbD1FgUzJ14LLb7E8= -github.com/lightninglabs/taproot-assets/taprpc v1.0.10-0.20251014100421-92189161aa7a h1:DdRL02D3nxYswEcYEEHQctEIWwxKws1XwPJ/Z3a8GD8= -github.com/lightninglabs/taproot-assets/taprpc v1.0.10-0.20251014100421-92189161aa7a/go.mod h1:ufuKxkMNdfRnv4IcnLw7ken69DcCUxO79WSpC8mIvdM= +github.com/lightninglabs/taproot-assets v0.7.0-rc2 h1:5fACDIbbRrSfx0n/L1+WwUe5w3tw4TNii1GxT+K1Bkc= +github.com/lightninglabs/taproot-assets v0.7.0-rc2/go.mod h1:qC9TBmn7gV+6LrDhacCe2DD0MnMbD1FgUzJ14LLb7E8= +github.com/lightninglabs/taproot-assets/taprpc v1.0.10 h1:F88dKn9X/Ik1onpf60Q6XDdBl7UQ85gXJL6e8JIk2Fc= +github.com/lightninglabs/taproot-assets/taprpc v1.0.10/go.mod h1:ufuKxkMNdfRnv4IcnLw7ken69DcCUxO79WSpC8mIvdM= github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9 h1:6D3LrdagJweLLdFm1JNodZsBk6iU4TTsBBFLQ4yiXfI= github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9/go.mod h1:EDqJ3MuZIbMq0QI1czTIKDJ/GS8S14RXPwapHw8cw6w= -github.com/lightningnetwork/lnd v0.20.0-beta.rc1 h1:8Rm3/pcSLQI+tpCjKfYADfMjmEVFkrtoEom470siKRA= -github.com/lightningnetwork/lnd v0.20.0-beta.rc1/go.mod h1:SgniBRmo5pE7IImxIfhUofhgdXkutcV9Znrf/rEZ7TM= +github.com/lightningnetwork/lnd v0.20.0-beta.rc2 h1:5ZbjqhqZCGeJPG+7S1NMB4LIa3pXx2JH9wfyq5Gl2aY= +github.com/lightningnetwork/lnd v0.20.0-beta.rc2/go.mod h1:iypbY+dTgHmC+HOu5kW8JwnyA13Jzicb/aF5JMkwoWo= github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI= github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U= github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0= github.com/lightningnetwork/lnd/clock v1.1.1/go.mod h1:mGnAhPyjYZQJmebS7aevElXKTFDuO+uNFFfMXK1W8xQ= github.com/lightningnetwork/lnd/fn v1.2.5 h1:pGMz0BDUxrhvOtShD4FIysdVy+ulfFAnFvTKjZO5Pp8= github.com/lightningnetwork/lnd/fn v1.2.5/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0= -github.com/lightningnetwork/lnd/fn/v2 v2.0.8 h1:r2SLz7gZYQPVc3IZhU82M66guz3Zk2oY+Rlj9QN5S3g= -github.com/lightningnetwork/lnd/fn/v2 v2.0.8/go.mod h1:TOzwrhjB/Azw1V7aa8t21ufcQmdsQOQMDtxVOQWNl8s= +github.com/lightningnetwork/lnd/fn/v2 v2.0.9 h1:ZytG4ltPac/sCyg1EJDn10RGzPIDJeyennUMRdOw7Y8= +github.com/lightningnetwork/lnd/fn/v2 v2.0.9/go.mod h1:aPUJHJ31S+Lgoo8I5SxDIjnmeCifqujaiTXKZqpav3w= github.com/lightningnetwork/lnd/healthcheck v1.2.6 h1:1sWhqr93GdkWy4+6U7JxBfcyZIE78MhIHTJZfPx7qqI= github.com/lightningnetwork/lnd/healthcheck v1.2.6/go.mod h1:Mu02um4CWY/zdTOvFje7WJgJcHyX2zq/FG3MhOAiGaQ= github.com/lightningnetwork/lnd/kvdb v1.4.16 h1:9BZgWdDfjmHRHLS97cz39bVuBAqMc4/p3HX1xtUdbDI= diff --git a/proto/loop.proto b/proto/loop.proto index f0510854..b57f10d0 100644 --- a/proto/loop.proto +++ b/proto/loop.proto @@ -845,6 +845,13 @@ message QuoteRequest { This option only pertains to loop in swaps. */ bool auto_select_deposits = 10; + + /* + If set to true the server will immediately publish the swap in exchange for + a higher fee. This can be useful if the client expects change from a swap. + Note that this feature is only available for static address loop in swaps. + */ + bool fast = 11; } message InQuoteResponse { @@ -874,6 +881,13 @@ message InQuoteResponse { The confirmation target to be used to publish the on-chain HTLC. */ int32 conf_target = 6; + + /* + If the quote request was for a static address loop in and only contained + deposit outpoints the quote response will return the total amount of the + selected deposits. + */ + int64 quoted_amt = 7 [jstype = JS_STRING]; } message OutQuoteResponse { @@ -2116,6 +2130,9 @@ message StaticAddressLoopInRequest { canceled to allow the user to safe on transaction fees. */ int64 amount = 9 [jstype = JS_STRING]; + + // If set, request the server to use fast publication behavior. + bool fast = 10; } message StaticAddressLoopInResponse { @@ -2180,6 +2197,28 @@ message StaticAddressLoopInResponse { side and the client can retry the swap with different parameters. */ uint32 payment_timeout_seconds = 11; + + /* + The deposits that are used for this swap. + */ + repeated Deposit used_deposits = 12; + + /* + The amount that is being swapped (may be less than total deposit value if + change is returned). + */ + uint64 swap_amount = 13 [jstype = JS_STRING]; + + /* + The change amount that will be returned to the static address. + */ + int64 change = 14 [jstype = JS_STRING]; + + /* + If set, indicates that the server was requested to use fast publication + behavior. + */ + bool fast = 15; } message AssetLoopOutRequest { diff --git a/proto/swapserverrpc/server.proto b/proto/swapserverrpc/server.proto index fec99ecd..e72f0668 100644 --- a/proto/swapserverrpc/server.proto +++ b/proto/swapserverrpc/server.proto @@ -294,6 +294,10 @@ message ServerLoopInQuoteRequest { // service fee. This is to cover for the increased on-chain fee the server // has to pay when the sweeping transaction is broadcast. uint32 num_static_address_deposits = 7; + + // If set, request the server to use fast publication behavior. Note that + // this falg is only available for static address loop ins. + bool fast = 8; } message ServerLoopInQuoteResponse { @@ -660,6 +664,12 @@ message FetchL402Response { // SubscribeNotificationsRequest is a request to subscribe to notifications. message SubscribeNotificationsRequest { + enum ListenerVersion { + LEGACY = 0; + V1 = 1; + } + + ListenerVersion version = 1; } // SubscribeNotificationsResponse is a response to a @@ -668,6 +678,7 @@ message SubscribeNotificationsResponse { oneof notification { ServerReservationNotification reservation_notification = 1; ServerStaticLoopInSweepNotification static_loop_in_sweep = 2; + ServerUnfinishedSwapNotification unfinished_swap = 3; } } @@ -687,3 +698,14 @@ message ServerStaticLoopInSweepNotification { // The prevout information of the sweep txn. repeated PrevoutInfo prevout_info = 4; } + +// ServerUnfinishedSwapNotification notifies the client about an unfinished +// swap that needs attention. This is useful in client data loss scenarios to +// help the client recover the swap. +message ServerUnfinishedSwapNotification { + // The swap hash of the unfinished swap. + bytes swap_hash = 1; + + // Whether the swap is a loop in or loop out. + bool is_loop_in = 2; +}