mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
Merge pull request #848 from lightninglabs/update-to-lnd-18-4
Prepare for custom channels (lnd v0.18.4-beta)
This commit is contained in:
commit
f73b43a70e
44 changed files with 15312 additions and 1502 deletions
|
|
@ -78,6 +78,7 @@ in remote mode (meaning that `lnd-mode=remote` is set). It shows the
|
|||
|
||||
| LiT | LND |
|
||||
|-------------------|--------------|
|
||||
| **v0.14.0-alpha** | v0.18.4-beta |
|
||||
| **v0.13.6-alpha** | v0.17.1-beta |
|
||||
| **v0.13.5-alpha** | v0.17.1-beta |
|
||||
| **v0.13.4-alpha** | v0.17.1-beta |
|
||||
|
|
@ -158,10 +159,16 @@ The following table shows the supported combinations:
|
|||
| `taproot-assets-mode=disable` | X | X |
|
||||
| `lnd` running in "stateless init" mode | X | |
|
||||
|
||||
NOTE: Taproot Assets **Channel** functionality is only available when both `lnd`
|
||||
and `tapd` are running in the same process (by setting both
|
||||
`lnd-mode=integrated` and `taproot-assets-mode=integrated`). Remote mode support
|
||||
will be added in the future.
|
||||
|
||||
## Daemon Versions packaged with LiT
|
||||
|
||||
| LiT | LND | Loop | Faraday | Pool | Taproot Assets |
|
||||
|-------------------|--------------|--------------|---------------|--------------|----------------|
|
||||
| **v0.14.0-alpha** | v0.18.4-beta | v0.29.0-beta | v0.2.13-alpha | v0.6.5-beta | v0.5.0-alpha |
|
||||
| **v0.13.6-alpha** | v0.18.3-beta | v0.28.8-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha |
|
||||
| **v0.13.5-alpha** | v0.18.3-beta | v0.28.8-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha |
|
||||
| **v0.13.4-alpha** | v0.18.3-beta | v0.28.7-beta | v0.2.13-alpha | v0.6.5-beta | v0.4.1-alpha |
|
||||
|
|
|
|||
92
app/src/types/generated/lnd_pb.d.ts
generated
vendored
92
app/src/types/generated/lnd_pb.d.ts
generated
vendored
|
|
@ -1506,6 +1506,11 @@ export class Channel extends jspb.Message {
|
|||
getMemo(): string;
|
||||
setMemo(value: string): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Channel.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Channel): Channel.AsObject;
|
||||
|
|
@ -1554,6 +1559,7 @@ export namespace Channel {
|
|||
peerAlias: string,
|
||||
peerScidAlias: string,
|
||||
memo: string,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2349,6 +2355,42 @@ export namespace ChannelOpenUpdate {
|
|||
}
|
||||
}
|
||||
|
||||
export class CloseOutput extends jspb.Message {
|
||||
getAmountSat(): string;
|
||||
setAmountSat(value: string): void;
|
||||
|
||||
getPkScript(): Uint8Array | string;
|
||||
getPkScript_asU8(): Uint8Array;
|
||||
getPkScript_asB64(): string;
|
||||
setPkScript(value: Uint8Array | string): void;
|
||||
|
||||
getIsLocal(): boolean;
|
||||
setIsLocal(value: boolean): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CloseOutput.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CloseOutput): CloseOutput.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: CloseOutput, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): CloseOutput;
|
||||
static deserializeBinaryFromReader(message: CloseOutput, reader: jspb.BinaryReader): CloseOutput;
|
||||
}
|
||||
|
||||
export namespace CloseOutput {
|
||||
export type AsObject = {
|
||||
amountSat: string,
|
||||
pkScript: Uint8Array | string,
|
||||
isLocal: boolean,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
export class ChannelCloseUpdate extends jspb.Message {
|
||||
getClosingTxid(): Uint8Array | string;
|
||||
getClosingTxid_asU8(): Uint8Array;
|
||||
|
|
@ -2358,6 +2400,21 @@ export class ChannelCloseUpdate extends jspb.Message {
|
|||
getSuccess(): boolean;
|
||||
setSuccess(value: boolean): void;
|
||||
|
||||
hasLocalCloseOutput(): boolean;
|
||||
clearLocalCloseOutput(): void;
|
||||
getLocalCloseOutput(): CloseOutput | undefined;
|
||||
setLocalCloseOutput(value?: CloseOutput): void;
|
||||
|
||||
hasRemoteCloseOutput(): boolean;
|
||||
clearRemoteCloseOutput(): void;
|
||||
getRemoteCloseOutput(): CloseOutput | undefined;
|
||||
setRemoteCloseOutput(value?: CloseOutput): void;
|
||||
|
||||
clearAdditionalOutputsList(): void;
|
||||
getAdditionalOutputsList(): Array<CloseOutput>;
|
||||
setAdditionalOutputsList(value: Array<CloseOutput>): void;
|
||||
addAdditionalOutputs(value?: CloseOutput, index?: number): CloseOutput;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ChannelCloseUpdate.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ChannelCloseUpdate): ChannelCloseUpdate.AsObject;
|
||||
|
|
@ -2372,6 +2429,9 @@ export namespace ChannelCloseUpdate {
|
|||
export type AsObject = {
|
||||
closingTxid: Uint8Array | string,
|
||||
success: boolean,
|
||||
localCloseOutput?: CloseOutput.AsObject,
|
||||
remoteCloseOutput?: CloseOutput.AsObject,
|
||||
additionalOutputsList: Array<CloseOutput.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3356,6 +3416,11 @@ export namespace PendingChannelsResponse {
|
|||
getMemo(): string;
|
||||
setMemo(value: string): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PendingChannel.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PendingChannel): PendingChannel.AsObject;
|
||||
|
|
@ -3381,6 +3446,7 @@ export namespace PendingChannelsResponse {
|
|||
chanStatusFlags: string,
|
||||
pb_private: boolean,
|
||||
memo: string,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3847,6 +3913,11 @@ export class ChannelBalanceResponse extends jspb.Message {
|
|||
getPendingOpenRemoteBalance(): Amount | undefined;
|
||||
setPendingOpenRemoteBalance(value?: Amount): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ChannelBalanceResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ChannelBalanceResponse): ChannelBalanceResponse.AsObject;
|
||||
|
|
@ -3867,6 +3938,7 @@ export namespace ChannelBalanceResponse {
|
|||
unsettledRemoteBalance?: Amount.AsObject,
|
||||
pendingOpenLocalBalance?: Amount.AsObject,
|
||||
pendingOpenRemoteBalance?: Amount.AsObject,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4221,6 +4293,14 @@ export class Route extends jspb.Message {
|
|||
getTotalAmtMsat(): string;
|
||||
setTotalAmtMsat(value: string): void;
|
||||
|
||||
getFirstHopAmountMsat(): string;
|
||||
setFirstHopAmountMsat(value: string): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Route.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Route): Route.AsObject;
|
||||
|
|
@ -4239,6 +4319,8 @@ export namespace Route {
|
|||
hopsList: Array<Hop.AsObject>,
|
||||
totalFeesMsat: string,
|
||||
totalAmtMsat: string,
|
||||
firstHopAmountMsat: string,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5354,6 +5436,11 @@ export class InvoiceHTLC extends jspb.Message {
|
|||
getAmp(): AMP | undefined;
|
||||
setAmp(value?: AMP): void;
|
||||
|
||||
getCustomChannelData(): Uint8Array | string;
|
||||
getCustomChannelData_asU8(): Uint8Array;
|
||||
getCustomChannelData_asB64(): string;
|
||||
setCustomChannelData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): InvoiceHTLC.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: InvoiceHTLC): InvoiceHTLC.AsObject;
|
||||
|
|
@ -5377,6 +5464,7 @@ export namespace InvoiceHTLC {
|
|||
customRecordsMap: Array<[number, Uint8Array | string]>,
|
||||
mppTotalAmtMsat: string,
|
||||
amp?: AMP.AsObject,
|
||||
customChannelData: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5628,6 +5716,8 @@ export class Payment extends jspb.Message {
|
|||
getFailureReason(): PaymentFailureReasonMap[keyof PaymentFailureReasonMap];
|
||||
setFailureReason(value: PaymentFailureReasonMap[keyof PaymentFailureReasonMap]): void;
|
||||
|
||||
getFirstHopCustomRecordsMap(): jspb.Map<number, Uint8Array | string>;
|
||||
clearFirstHopCustomRecordsMap(): void;
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Payment.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Payment): Payment.AsObject;
|
||||
|
|
@ -5655,6 +5745,7 @@ export namespace Payment {
|
|||
htlcsList: Array<HTLCAttempt.AsObject>,
|
||||
paymentIndex: string,
|
||||
failureReason: PaymentFailureReasonMap[keyof PaymentFailureReasonMap],
|
||||
firstHopCustomRecordsMap: Array<[number, Uint8Array | string]>,
|
||||
}
|
||||
|
||||
export interface PaymentStatusMap {
|
||||
|
|
@ -7439,6 +7530,7 @@ export interface CommitmentTypeMap {
|
|||
ANCHORS: 3;
|
||||
SCRIPT_ENFORCED_LEASE: 4;
|
||||
SIMPLE_TAPROOT: 5;
|
||||
SIMPLE_TAPROOT_OVERLAY: 6;
|
||||
}
|
||||
|
||||
export const CommitmentType: CommitmentTypeMap;
|
||||
|
|
|
|||
805
app/src/types/generated/lnd_pb.js
generated
805
app/src/types/generated/lnd_pb.js
generated
|
|
@ -75,6 +75,7 @@ goog.exportSymbol('proto.lnrpc.ChannelUpdate', null, global);
|
|||
goog.exportSymbol('proto.lnrpc.CheckMacPermRequest', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.CheckMacPermResponse', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.CloseChannelRequest', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.CloseOutput', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.CloseStatusUpdate', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.CloseStatusUpdate.UpdateCase', null, global);
|
||||
goog.exportSymbol('proto.lnrpc.ClosedChannelUpdate', null, global);
|
||||
|
|
@ -1658,9 +1659,30 @@ if (goog.DEBUG && !COMPILED) {
|
|||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate = function(opt_data) {
|
||||
proto.lnrpc.CloseOutput = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.lnrpc.CloseOutput, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.displayName = 'proto.lnrpc.CloseOutput';
|
||||
}
|
||||
/**
|
||||
* 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.ChannelCloseUpdate = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.lnrpc.ChannelCloseUpdate.repeatedFields_, null);
|
||||
};
|
||||
goog.inherits(proto.lnrpc.ChannelCloseUpdate, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
|
|
@ -14527,7 +14549,8 @@ proto.lnrpc.Channel.toObject = function(includeInstance, msg) {
|
|||
zeroConfConfirmedScid: jspb.Message.getFieldWithDefault(msg, 33, "0"),
|
||||
peerAlias: jspb.Message.getFieldWithDefault(msg, 34, ""),
|
||||
peerScidAlias: jspb.Message.getFieldWithDefault(msg, 35, "0"),
|
||||
memo: jspb.Message.getFieldWithDefault(msg, 36, "")
|
||||
memo: jspb.Message.getFieldWithDefault(msg, 36, ""),
|
||||
customChannelData: msg.getCustomChannelData_asB64()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -14713,6 +14736,10 @@ proto.lnrpc.Channel.deserializeBinaryFromReader = function(msg, reader) {
|
|||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setMemo(value);
|
||||
break;
|
||||
case 37:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -14997,6 +15024,13 @@ proto.lnrpc.Channel.serializeBinaryToWriter = function(message, writer) {
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
37,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -15725,6 +15759,48 @@ proto.lnrpc.Channel.prototype.setMemo = function(value) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 37;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.Channel.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 37, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 37;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.Channel.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 37;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.Channel.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.Channel} returns this
|
||||
*/
|
||||
proto.lnrpc.Channel.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 37, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -21233,6 +21309,281 @@ proto.lnrpc.ChannelOpenUpdate.prototype.hasChannelPoint = function() {
|
|||
|
||||
|
||||
|
||||
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_<name>, 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.lnrpc.CloseOutput.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.lnrpc.CloseOutput.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.lnrpc.CloseOutput} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
amountSat: jspb.Message.getFieldWithDefault(msg, 1, "0"),
|
||||
pkScript: msg.getPkScript_asB64(),
|
||||
isLocal: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
|
||||
customChannelData: msg.getCustomChannelData_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.lnrpc.CloseOutput}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.lnrpc.CloseOutput;
|
||||
return proto.lnrpc.CloseOutput.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.lnrpc.CloseOutput} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.lnrpc.CloseOutput}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {string} */ (reader.readInt64String());
|
||||
msg.setAmountSat(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setPkScript(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setIsLocal(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.lnrpc.CloseOutput.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.CloseOutput} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getAmountSat();
|
||||
if (parseInt(f, 10) !== 0) {
|
||||
writer.writeInt64String(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getPkScript_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getIsLocal();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional int64 amount_sat = 1;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getAmountSat = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0"));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.lnrpc.CloseOutput} returns this
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.setAmountSat = function(value) {
|
||||
return jspb.Message.setProto3StringIntField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes pk_script = 2;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getPkScript = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes pk_script = 2;
|
||||
* This is a type-conversion wrapper around `getPkScript()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getPkScript_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getPkScript()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes pk_script = 2;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getPkScript()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getPkScript_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getPkScript()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.CloseOutput} returns this
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.setPkScript = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool is_local = 3;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getIsLocal = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.lnrpc.CloseOutput} returns this
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.setIsLocal = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 4;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 4;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 4;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.CloseOutput} returns this
|
||||
*/
|
||||
proto.lnrpc.CloseOutput.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.repeatedFields_ = [5];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
|
|
@ -21263,7 +21614,11 @@ proto.lnrpc.ChannelCloseUpdate.prototype.toObject = function(opt_includeInstance
|
|||
proto.lnrpc.ChannelCloseUpdate.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
closingTxid: msg.getClosingTxid_asB64(),
|
||||
success: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
|
||||
success: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
|
||||
localCloseOutput: (f = msg.getLocalCloseOutput()) && proto.lnrpc.CloseOutput.toObject(includeInstance, f),
|
||||
remoteCloseOutput: (f = msg.getRemoteCloseOutput()) && proto.lnrpc.CloseOutput.toObject(includeInstance, f),
|
||||
additionalOutputsList: jspb.Message.toObjectList(msg.getAdditionalOutputsList(),
|
||||
proto.lnrpc.CloseOutput.toObject, includeInstance)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -21308,6 +21663,21 @@ proto.lnrpc.ChannelCloseUpdate.deserializeBinaryFromReader = function(msg, reade
|
|||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setSuccess(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = new proto.lnrpc.CloseOutput;
|
||||
reader.readMessage(value,proto.lnrpc.CloseOutput.deserializeBinaryFromReader);
|
||||
msg.setLocalCloseOutput(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = new proto.lnrpc.CloseOutput;
|
||||
reader.readMessage(value,proto.lnrpc.CloseOutput.deserializeBinaryFromReader);
|
||||
msg.setRemoteCloseOutput(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = new proto.lnrpc.CloseOutput;
|
||||
reader.readMessage(value,proto.lnrpc.CloseOutput.deserializeBinaryFromReader);
|
||||
msg.addAdditionalOutputs(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -21351,6 +21721,30 @@ proto.lnrpc.ChannelCloseUpdate.serializeBinaryToWriter = function(message, write
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getLocalCloseOutput();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
3,
|
||||
f,
|
||||
proto.lnrpc.CloseOutput.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getRemoteCloseOutput();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
4,
|
||||
f,
|
||||
proto.lnrpc.CloseOutput.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getAdditionalOutputsList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedMessage(
|
||||
5,
|
||||
f,
|
||||
proto.lnrpc.CloseOutput.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -21414,6 +21808,118 @@ proto.lnrpc.ChannelCloseUpdate.prototype.setSuccess = function(value) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional CloseOutput local_close_output = 3;
|
||||
* @return {?proto.lnrpc.CloseOutput}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.getLocalCloseOutput = function() {
|
||||
return /** @type{?proto.lnrpc.CloseOutput} */ (
|
||||
jspb.Message.getWrapperField(this, proto.lnrpc.CloseOutput, 3));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.lnrpc.CloseOutput|undefined} value
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.setLocalCloseOutput = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.clearLocalCloseOutput = function() {
|
||||
return this.setLocalCloseOutput(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.hasLocalCloseOutput = function() {
|
||||
return jspb.Message.getField(this, 3) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional CloseOutput remote_close_output = 4;
|
||||
* @return {?proto.lnrpc.CloseOutput}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.getRemoteCloseOutput = function() {
|
||||
return /** @type{?proto.lnrpc.CloseOutput} */ (
|
||||
jspb.Message.getWrapperField(this, proto.lnrpc.CloseOutput, 4));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.lnrpc.CloseOutput|undefined} value
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.setRemoteCloseOutput = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.clearRemoteCloseOutput = function() {
|
||||
return this.setRemoteCloseOutput(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.hasRemoteCloseOutput = function() {
|
||||
return jspb.Message.getField(this, 4) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated CloseOutput additional_outputs = 5;
|
||||
* @return {!Array<!proto.lnrpc.CloseOutput>}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.getAdditionalOutputsList = function() {
|
||||
return /** @type{!Array<!proto.lnrpc.CloseOutput>} */ (
|
||||
jspb.Message.getRepeatedWrapperField(this, proto.lnrpc.CloseOutput, 5));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<!proto.lnrpc.CloseOutput>} value
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.setAdditionalOutputsList = function(value) {
|
||||
return jspb.Message.setRepeatedWrapperField(this, 5, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!proto.lnrpc.CloseOutput=} opt_value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.lnrpc.CloseOutput}
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.addAdditionalOutputs = function(opt_value, opt_index) {
|
||||
return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.lnrpc.CloseOutput, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.lnrpc.ChannelCloseUpdate} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelCloseUpdate.prototype.clearAdditionalOutputsList = function() {
|
||||
return this.setAdditionalOutputsList([]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -28102,7 +28608,8 @@ proto.lnrpc.PendingChannelsResponse.PendingChannel.toObject = function(includeIn
|
|||
numForwardingPackages: jspb.Message.getFieldWithDefault(msg, 10, "0"),
|
||||
chanStatusFlags: jspb.Message.getFieldWithDefault(msg, 11, ""),
|
||||
pb_private: jspb.Message.getBooleanFieldWithDefault(msg, 12, false),
|
||||
memo: jspb.Message.getFieldWithDefault(msg, 13, "")
|
||||
memo: jspb.Message.getFieldWithDefault(msg, 13, ""),
|
||||
customChannelData: msg.getCustomChannelData_asB64()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -28191,6 +28698,10 @@ proto.lnrpc.PendingChannelsResponse.PendingChannel.deserializeBinaryFromReader =
|
|||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setMemo(value);
|
||||
break;
|
||||
case 34:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -28311,6 +28822,13 @@ proto.lnrpc.PendingChannelsResponse.PendingChannel.serializeBinaryToWriter = fun
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
34,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -28548,6 +29066,48 @@ proto.lnrpc.PendingChannelsResponse.PendingChannel.prototype.setMemo = function(
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 34;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.PendingChannelsResponse.PendingChannel.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 34, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 34;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.PendingChannelsResponse.PendingChannel.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 34;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.PendingChannelsResponse.PendingChannel.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.PendingChannelsResponse.PendingChannel} returns this
|
||||
*/
|
||||
proto.lnrpc.PendingChannelsResponse.PendingChannel.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 34, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -31625,7 +32185,8 @@ proto.lnrpc.ChannelBalanceResponse.toObject = function(includeInstance, msg) {
|
|||
unsettledLocalBalance: (f = msg.getUnsettledLocalBalance()) && proto.lnrpc.Amount.toObject(includeInstance, f),
|
||||
unsettledRemoteBalance: (f = msg.getUnsettledRemoteBalance()) && proto.lnrpc.Amount.toObject(includeInstance, f),
|
||||
pendingOpenLocalBalance: (f = msg.getPendingOpenLocalBalance()) && proto.lnrpc.Amount.toObject(includeInstance, f),
|
||||
pendingOpenRemoteBalance: (f = msg.getPendingOpenRemoteBalance()) && proto.lnrpc.Amount.toObject(includeInstance, f)
|
||||
pendingOpenRemoteBalance: (f = msg.getPendingOpenRemoteBalance()) && proto.lnrpc.Amount.toObject(includeInstance, f),
|
||||
customChannelData: msg.getCustomChannelData_asB64()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -31700,6 +32261,10 @@ proto.lnrpc.ChannelBalanceResponse.deserializeBinaryFromReader = function(msg, r
|
|||
reader.readMessage(value,proto.lnrpc.Amount.deserializeBinaryFromReader);
|
||||
msg.setPendingOpenRemoteBalance(value);
|
||||
break;
|
||||
case 9:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -31791,6 +32356,13 @@ proto.lnrpc.ChannelBalanceResponse.serializeBinaryToWriter = function(message, w
|
|||
proto.lnrpc.Amount.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
9,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -32052,6 +32624,48 @@ proto.lnrpc.ChannelBalanceResponse.prototype.hasPendingOpenRemoteBalance = funct
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 9;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.ChannelBalanceResponse.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 9;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.ChannelBalanceResponse.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 9;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.ChannelBalanceResponse.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.ChannelBalanceResponse} returns this
|
||||
*/
|
||||
proto.lnrpc.ChannelBalanceResponse.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 9, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
|
|
@ -34627,7 +35241,9 @@ proto.lnrpc.Route.toObject = function(includeInstance, msg) {
|
|||
hopsList: jspb.Message.toObjectList(msg.getHopsList(),
|
||||
proto.lnrpc.Hop.toObject, includeInstance),
|
||||
totalFeesMsat: jspb.Message.getFieldWithDefault(msg, 5, "0"),
|
||||
totalAmtMsat: jspb.Message.getFieldWithDefault(msg, 6, "0")
|
||||
totalAmtMsat: jspb.Message.getFieldWithDefault(msg, 6, "0"),
|
||||
firstHopAmountMsat: jspb.Message.getFieldWithDefault(msg, 7, "0"),
|
||||
customChannelData: msg.getCustomChannelData_asB64()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -34689,6 +35305,14 @@ proto.lnrpc.Route.deserializeBinaryFromReader = function(msg, reader) {
|
|||
var value = /** @type {string} */ (reader.readInt64String());
|
||||
msg.setTotalAmtMsat(value);
|
||||
break;
|
||||
case 7:
|
||||
var value = /** @type {string} */ (reader.readInt64String());
|
||||
msg.setFirstHopAmountMsat(value);
|
||||
break;
|
||||
case 8:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -34761,6 +35385,20 @@ proto.lnrpc.Route.serializeBinaryToWriter = function(message, writer) {
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getFirstHopAmountMsat();
|
||||
if (parseInt(f, 10) !== 0) {
|
||||
writer.writeInt64String(
|
||||
7,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
8,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -34892,6 +35530,66 @@ proto.lnrpc.Route.prototype.setTotalAmtMsat = function(value) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional int64 first_hop_amount_msat = 7;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.getFirstHopAmountMsat = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "0"));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.lnrpc.Route} returns this
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.setFirstHopAmountMsat = function(value) {
|
||||
return jspb.Message.setProto3StringIntField(this, 7, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 8;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 8;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 8;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.Route} returns this
|
||||
*/
|
||||
proto.lnrpc.Route.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 8, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -42799,7 +43497,8 @@ proto.lnrpc.InvoiceHTLC.toObject = function(includeInstance, msg) {
|
|||
state: jspb.Message.getFieldWithDefault(msg, 8, 0),
|
||||
customRecordsMap: (f = msg.getCustomRecordsMap()) ? f.toObject(includeInstance, undefined) : [],
|
||||
mppTotalAmtMsat: jspb.Message.getFieldWithDefault(msg, 10, "0"),
|
||||
amp: (f = msg.getAmp()) && proto.lnrpc.AMP.toObject(includeInstance, f)
|
||||
amp: (f = msg.getAmp()) && proto.lnrpc.AMP.toObject(includeInstance, f),
|
||||
customChannelData: msg.getCustomChannelData_asB64()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -42883,6 +43582,10 @@ proto.lnrpc.InvoiceHTLC.deserializeBinaryFromReader = function(msg, reader) {
|
|||
reader.readMessage(value,proto.lnrpc.AMP.deserializeBinaryFromReader);
|
||||
msg.setAmp(value);
|
||||
break;
|
||||
case 12:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setCustomChannelData(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -42987,6 +43690,13 @@ proto.lnrpc.InvoiceHTLC.serializeBinaryToWriter = function(message, writer) {
|
|||
proto.lnrpc.AMP.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getCustomChannelData_asU8();
|
||||
if (f.length > 0) {
|
||||
writer.writeBytes(
|
||||
12,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -43212,6 +43922,48 @@ proto.lnrpc.InvoiceHTLC.prototype.hasAmp = function() {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 12;
|
||||
* @return {!(string|Uint8Array)}
|
||||
*/
|
||||
proto.lnrpc.InvoiceHTLC.prototype.getCustomChannelData = function() {
|
||||
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 12;
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {string}
|
||||
*/
|
||||
proto.lnrpc.InvoiceHTLC.prototype.getCustomChannelData_asB64 = function() {
|
||||
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bytes custom_channel_data = 12;
|
||||
* Note that Uint8Array is not supported on all browsers.
|
||||
* @see http://caniuse.com/Uint8Array
|
||||
* This is a type-conversion wrapper around `getCustomChannelData()`
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.lnrpc.InvoiceHTLC.prototype.getCustomChannelData_asU8 = function() {
|
||||
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
||||
this.getCustomChannelData()));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!(string|Uint8Array)} value
|
||||
* @return {!proto.lnrpc.InvoiceHTLC} returns this
|
||||
*/
|
||||
proto.lnrpc.InvoiceHTLC.prototype.setCustomChannelData = function(value) {
|
||||
return jspb.Message.setProto3BytesField(this, 12, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -44724,7 +45476,8 @@ proto.lnrpc.Payment.toObject = function(includeInstance, msg) {
|
|||
htlcsList: jspb.Message.toObjectList(msg.getHtlcsList(),
|
||||
proto.lnrpc.HTLCAttempt.toObject, includeInstance),
|
||||
paymentIndex: jspb.Message.getFieldWithDefault(msg, 15, "0"),
|
||||
failureReason: jspb.Message.getFieldWithDefault(msg, 16, 0)
|
||||
failureReason: jspb.Message.getFieldWithDefault(msg, 16, 0),
|
||||
firstHopCustomRecordsMap: (f = msg.getFirstHopCustomRecordsMap()) ? f.toObject(includeInstance, undefined) : []
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
|
@ -44822,6 +45575,12 @@ proto.lnrpc.Payment.deserializeBinaryFromReader = function(msg, reader) {
|
|||
var value = /** @type {!proto.lnrpc.PaymentFailureReason} */ (reader.readEnum());
|
||||
msg.setFailureReason(value);
|
||||
break;
|
||||
case 17:
|
||||
var value = msg.getFirstHopCustomRecordsMap();
|
||||
reader.readMessage(value, function(message, reader) {
|
||||
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint64, jspb.BinaryReader.prototype.readBytes, null, 0, "");
|
||||
});
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
|
@ -44957,6 +45716,10 @@ proto.lnrpc.Payment.serializeBinaryToWriter = function(message, writer) {
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getFirstHopCustomRecordsMap(true);
|
||||
if (f && f.getLength() > 0) {
|
||||
f.serializeBinary(17, writer, jspb.BinaryWriter.prototype.writeUint64, jspb.BinaryWriter.prototype.writeBytes);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -45261,6 +46024,29 @@ proto.lnrpc.Payment.prototype.setFailureReason = function(value) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* map<uint64, bytes> first_hop_custom_records = 17;
|
||||
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
||||
* empty, instead returning `undefined`
|
||||
* @return {!jspb.Map<number,!(string|Uint8Array)>}
|
||||
*/
|
||||
proto.lnrpc.Payment.prototype.getFirstHopCustomRecordsMap = function(opt_noLazyCreate) {
|
||||
return /** @type {!jspb.Map<number,!(string|Uint8Array)>} */ (
|
||||
jspb.Message.getMapField(this, 17, opt_noLazyCreate,
|
||||
null));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears values from the map. The map will be non-null.
|
||||
* @return {!proto.lnrpc.Payment} returns this
|
||||
*/
|
||||
proto.lnrpc.Payment.prototype.clearFirstHopCustomRecordsMap = function() {
|
||||
this.getFirstHopCustomRecordsMap().clear();
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -57257,7 +58043,8 @@ proto.lnrpc.CommitmentType = {
|
|||
STATIC_REMOTE_KEY: 2,
|
||||
ANCHORS: 3,
|
||||
SCRIPT_ENFORCED_LEASE: 4,
|
||||
SIMPLE_TAPROOT: 5
|
||||
SIMPLE_TAPROOT: 5,
|
||||
SIMPLE_TAPROOT_OVERLAY: 6
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
635
app/src/types/generated/loop_pb.d.ts
generated
vendored
635
app/src/types/generated/loop_pb.d.ts
generated
vendored
|
|
@ -522,6 +522,11 @@ export class QuoteRequest extends jspb.Message {
|
|||
getPrivate(): boolean;
|
||||
setPrivate(value: boolean): void;
|
||||
|
||||
clearDepositOutpointsList(): void;
|
||||
getDepositOutpointsList(): Array<string>;
|
||||
setDepositOutpointsList(value: Array<string>): void;
|
||||
addDepositOutpoints(value: string, index?: number): string;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): QuoteRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: QuoteRequest): QuoteRequest.AsObject;
|
||||
|
|
@ -541,6 +546,7 @@ export namespace QuoteRequest {
|
|||
loopInLastHop: Uint8Array | string,
|
||||
loopInRouteHintsList: Array<swapserverrpc_common_pb.RouteHint.AsObject>,
|
||||
pb_private: boolean,
|
||||
depositOutpointsList: Array<string>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,6 +710,38 @@ export namespace TokensResponse {
|
|||
}
|
||||
}
|
||||
|
||||
export class FetchL402TokenRequest extends jspb.Message {
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): FetchL402TokenRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: FetchL402TokenRequest): FetchL402TokenRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: FetchL402TokenRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): FetchL402TokenRequest;
|
||||
static deserializeBinaryFromReader(message: FetchL402TokenRequest, reader: jspb.BinaryReader): FetchL402TokenRequest;
|
||||
}
|
||||
|
||||
export namespace FetchL402TokenRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class FetchL402TokenResponse extends jspb.Message {
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): FetchL402TokenResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: FetchL402TokenResponse): FetchL402TokenResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: FetchL402TokenResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): FetchL402TokenResponse;
|
||||
static deserializeBinaryFromReader(message: FetchL402TokenResponse, reader: jspb.BinaryReader): FetchL402TokenResponse;
|
||||
}
|
||||
|
||||
export namespace FetchL402TokenResponse {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class L402Token extends jspb.Message {
|
||||
getBaseMacaroon(): Uint8Array | string;
|
||||
getBaseMacaroon_asU8(): Uint8Array;
|
||||
|
|
@ -1470,6 +1508,570 @@ export namespace InstantOut {
|
|||
}
|
||||
}
|
||||
|
||||
export class NewStaticAddressRequest extends jspb.Message {
|
||||
getClientKey(): Uint8Array | string;
|
||||
getClientKey_asU8(): Uint8Array;
|
||||
getClientKey_asB64(): string;
|
||||
setClientKey(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): NewStaticAddressRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: NewStaticAddressRequest): NewStaticAddressRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: NewStaticAddressRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): NewStaticAddressRequest;
|
||||
static deserializeBinaryFromReader(message: NewStaticAddressRequest, reader: jspb.BinaryReader): NewStaticAddressRequest;
|
||||
}
|
||||
|
||||
export namespace NewStaticAddressRequest {
|
||||
export type AsObject = {
|
||||
clientKey: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
export class NewStaticAddressResponse extends jspb.Message {
|
||||
getAddress(): string;
|
||||
setAddress(value: string): void;
|
||||
|
||||
getExpiry(): number;
|
||||
setExpiry(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): NewStaticAddressResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: NewStaticAddressResponse): NewStaticAddressResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: NewStaticAddressResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): NewStaticAddressResponse;
|
||||
static deserializeBinaryFromReader(message: NewStaticAddressResponse, reader: jspb.BinaryReader): NewStaticAddressResponse;
|
||||
}
|
||||
|
||||
export namespace NewStaticAddressResponse {
|
||||
export type AsObject = {
|
||||
address: string,
|
||||
expiry: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class ListUnspentDepositsRequest extends jspb.Message {
|
||||
getMinConfs(): number;
|
||||
setMinConfs(value: number): void;
|
||||
|
||||
getMaxConfs(): number;
|
||||
setMaxConfs(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListUnspentDepositsRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListUnspentDepositsRequest): ListUnspentDepositsRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListUnspentDepositsRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListUnspentDepositsRequest;
|
||||
static deserializeBinaryFromReader(message: ListUnspentDepositsRequest, reader: jspb.BinaryReader): ListUnspentDepositsRequest;
|
||||
}
|
||||
|
||||
export namespace ListUnspentDepositsRequest {
|
||||
export type AsObject = {
|
||||
minConfs: number,
|
||||
maxConfs: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class ListUnspentDepositsResponse extends jspb.Message {
|
||||
clearUtxosList(): void;
|
||||
getUtxosList(): Array<Utxo>;
|
||||
setUtxosList(value: Array<Utxo>): void;
|
||||
addUtxos(value?: Utxo, index?: number): Utxo;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListUnspentDepositsResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListUnspentDepositsResponse): ListUnspentDepositsResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListUnspentDepositsResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListUnspentDepositsResponse;
|
||||
static deserializeBinaryFromReader(message: ListUnspentDepositsResponse, reader: jspb.BinaryReader): ListUnspentDepositsResponse;
|
||||
}
|
||||
|
||||
export namespace ListUnspentDepositsResponse {
|
||||
export type AsObject = {
|
||||
utxosList: Array<Utxo.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
export class Utxo extends jspb.Message {
|
||||
getStaticAddress(): string;
|
||||
setStaticAddress(value: string): void;
|
||||
|
||||
getAmountSat(): string;
|
||||
setAmountSat(value: string): void;
|
||||
|
||||
getOutpoint(): string;
|
||||
setOutpoint(value: string): void;
|
||||
|
||||
getConfirmations(): string;
|
||||
setConfirmations(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Utxo.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Utxo): Utxo.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: Utxo, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): Utxo;
|
||||
static deserializeBinaryFromReader(message: Utxo, reader: jspb.BinaryReader): Utxo;
|
||||
}
|
||||
|
||||
export namespace Utxo {
|
||||
export type AsObject = {
|
||||
staticAddress: string,
|
||||
amountSat: string,
|
||||
outpoint: string,
|
||||
confirmations: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class WithdrawDepositsRequest extends jspb.Message {
|
||||
clearOutpointsList(): void;
|
||||
getOutpointsList(): Array<OutPoint>;
|
||||
setOutpointsList(value: Array<OutPoint>): void;
|
||||
addOutpoints(value?: OutPoint, index?: number): OutPoint;
|
||||
|
||||
getAll(): boolean;
|
||||
setAll(value: boolean): void;
|
||||
|
||||
getDestAddr(): string;
|
||||
setDestAddr(value: string): void;
|
||||
|
||||
getSatPerVbyte(): string;
|
||||
setSatPerVbyte(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WithdrawDepositsRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WithdrawDepositsRequest): WithdrawDepositsRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: WithdrawDepositsRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): WithdrawDepositsRequest;
|
||||
static deserializeBinaryFromReader(message: WithdrawDepositsRequest, reader: jspb.BinaryReader): WithdrawDepositsRequest;
|
||||
}
|
||||
|
||||
export namespace WithdrawDepositsRequest {
|
||||
export type AsObject = {
|
||||
outpointsList: Array<OutPoint.AsObject>,
|
||||
all: boolean,
|
||||
destAddr: string,
|
||||
satPerVbyte: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class WithdrawDepositsResponse extends jspb.Message {
|
||||
getWithdrawalTxHash(): string;
|
||||
setWithdrawalTxHash(value: string): void;
|
||||
|
||||
getPkScript(): string;
|
||||
setPkScript(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WithdrawDepositsResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WithdrawDepositsResponse): WithdrawDepositsResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: WithdrawDepositsResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): WithdrawDepositsResponse;
|
||||
static deserializeBinaryFromReader(message: WithdrawDepositsResponse, reader: jspb.BinaryReader): WithdrawDepositsResponse;
|
||||
}
|
||||
|
||||
export namespace WithdrawDepositsResponse {
|
||||
export type AsObject = {
|
||||
withdrawalTxHash: string,
|
||||
pkScript: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class OutPoint extends jspb.Message {
|
||||
getTxidBytes(): Uint8Array | string;
|
||||
getTxidBytes_asU8(): Uint8Array;
|
||||
getTxidBytes_asB64(): string;
|
||||
setTxidBytes(value: Uint8Array | string): void;
|
||||
|
||||
getTxidStr(): string;
|
||||
setTxidStr(value: string): void;
|
||||
|
||||
getOutputIndex(): number;
|
||||
setOutputIndex(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): OutPoint.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: OutPoint): OutPoint.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: OutPoint, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): OutPoint;
|
||||
static deserializeBinaryFromReader(message: OutPoint, reader: jspb.BinaryReader): OutPoint;
|
||||
}
|
||||
|
||||
export namespace OutPoint {
|
||||
export type AsObject = {
|
||||
txidBytes: Uint8Array | string,
|
||||
txidStr: string,
|
||||
outputIndex: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class ListStaticAddressDepositsRequest extends jspb.Message {
|
||||
getStateFilter(): DepositStateMap[keyof DepositStateMap];
|
||||
setStateFilter(value: DepositStateMap[keyof DepositStateMap]): void;
|
||||
|
||||
clearOutpointsList(): void;
|
||||
getOutpointsList(): Array<string>;
|
||||
setOutpointsList(value: Array<string>): void;
|
||||
addOutpoints(value: string, index?: number): string;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListStaticAddressDepositsRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListStaticAddressDepositsRequest): ListStaticAddressDepositsRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListStaticAddressDepositsRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListStaticAddressDepositsRequest;
|
||||
static deserializeBinaryFromReader(message: ListStaticAddressDepositsRequest, reader: jspb.BinaryReader): ListStaticAddressDepositsRequest;
|
||||
}
|
||||
|
||||
export namespace ListStaticAddressDepositsRequest {
|
||||
export type AsObject = {
|
||||
stateFilter: DepositStateMap[keyof DepositStateMap],
|
||||
outpointsList: Array<string>,
|
||||
}
|
||||
}
|
||||
|
||||
export class ListStaticAddressDepositsResponse extends jspb.Message {
|
||||
clearFilteredDepositsList(): void;
|
||||
getFilteredDepositsList(): Array<Deposit>;
|
||||
setFilteredDepositsList(value: Array<Deposit>): void;
|
||||
addFilteredDeposits(value?: Deposit, index?: number): Deposit;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListStaticAddressDepositsResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListStaticAddressDepositsResponse): ListStaticAddressDepositsResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListStaticAddressDepositsResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListStaticAddressDepositsResponse;
|
||||
static deserializeBinaryFromReader(message: ListStaticAddressDepositsResponse, reader: jspb.BinaryReader): ListStaticAddressDepositsResponse;
|
||||
}
|
||||
|
||||
export namespace ListStaticAddressDepositsResponse {
|
||||
export type AsObject = {
|
||||
filteredDepositsList: Array<Deposit.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
export class ListStaticAddressSwapsRequest extends jspb.Message {
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListStaticAddressSwapsRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListStaticAddressSwapsRequest): ListStaticAddressSwapsRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListStaticAddressSwapsRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListStaticAddressSwapsRequest;
|
||||
static deserializeBinaryFromReader(message: ListStaticAddressSwapsRequest, reader: jspb.BinaryReader): ListStaticAddressSwapsRequest;
|
||||
}
|
||||
|
||||
export namespace ListStaticAddressSwapsRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class ListStaticAddressSwapsResponse extends jspb.Message {
|
||||
clearSwapsList(): void;
|
||||
getSwapsList(): Array<StaticAddressLoopInSwap>;
|
||||
setSwapsList(value: Array<StaticAddressLoopInSwap>): void;
|
||||
addSwaps(value?: StaticAddressLoopInSwap, index?: number): StaticAddressLoopInSwap;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ListStaticAddressSwapsResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ListStaticAddressSwapsResponse): ListStaticAddressSwapsResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ListStaticAddressSwapsResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ListStaticAddressSwapsResponse;
|
||||
static deserializeBinaryFromReader(message: ListStaticAddressSwapsResponse, reader: jspb.BinaryReader): ListStaticAddressSwapsResponse;
|
||||
}
|
||||
|
||||
export namespace ListStaticAddressSwapsResponse {
|
||||
export type AsObject = {
|
||||
swapsList: Array<StaticAddressLoopInSwap.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
export class StaticAddressSummaryRequest extends jspb.Message {
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): StaticAddressSummaryRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: StaticAddressSummaryRequest): StaticAddressSummaryRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: StaticAddressSummaryRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): StaticAddressSummaryRequest;
|
||||
static deserializeBinaryFromReader(message: StaticAddressSummaryRequest, reader: jspb.BinaryReader): StaticAddressSummaryRequest;
|
||||
}
|
||||
|
||||
export namespace StaticAddressSummaryRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class StaticAddressSummaryResponse extends jspb.Message {
|
||||
getStaticAddress(): string;
|
||||
setStaticAddress(value: string): void;
|
||||
|
||||
getRelativeExpiryBlocks(): string;
|
||||
setRelativeExpiryBlocks(value: string): void;
|
||||
|
||||
getTotalNumDeposits(): number;
|
||||
setTotalNumDeposits(value: number): void;
|
||||
|
||||
getValueUnconfirmedSatoshis(): string;
|
||||
setValueUnconfirmedSatoshis(value: string): void;
|
||||
|
||||
getValueDepositedSatoshis(): string;
|
||||
setValueDepositedSatoshis(value: string): void;
|
||||
|
||||
getValueExpiredSatoshis(): string;
|
||||
setValueExpiredSatoshis(value: string): void;
|
||||
|
||||
getValueWithdrawnSatoshis(): string;
|
||||
setValueWithdrawnSatoshis(value: string): void;
|
||||
|
||||
getValueLoopedInSatoshis(): string;
|
||||
setValueLoopedInSatoshis(value: string): void;
|
||||
|
||||
getValueHtlcTimeoutSweepsSatoshis(): string;
|
||||
setValueHtlcTimeoutSweepsSatoshis(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): StaticAddressSummaryResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: StaticAddressSummaryResponse): StaticAddressSummaryResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: StaticAddressSummaryResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): StaticAddressSummaryResponse;
|
||||
static deserializeBinaryFromReader(message: StaticAddressSummaryResponse, reader: jspb.BinaryReader): StaticAddressSummaryResponse;
|
||||
}
|
||||
|
||||
export namespace StaticAddressSummaryResponse {
|
||||
export type AsObject = {
|
||||
staticAddress: string,
|
||||
relativeExpiryBlocks: string,
|
||||
totalNumDeposits: number,
|
||||
valueUnconfirmedSatoshis: string,
|
||||
valueDepositedSatoshis: string,
|
||||
valueExpiredSatoshis: string,
|
||||
valueWithdrawnSatoshis: string,
|
||||
valueLoopedInSatoshis: string,
|
||||
valueHtlcTimeoutSweepsSatoshis: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class Deposit extends jspb.Message {
|
||||
getId(): Uint8Array | string;
|
||||
getId_asU8(): Uint8Array;
|
||||
getId_asB64(): string;
|
||||
setId(value: Uint8Array | string): void;
|
||||
|
||||
getState(): DepositStateMap[keyof DepositStateMap];
|
||||
setState(value: DepositStateMap[keyof DepositStateMap]): void;
|
||||
|
||||
getOutpoint(): string;
|
||||
setOutpoint(value: string): void;
|
||||
|
||||
getValue(): string;
|
||||
setValue(value: string): void;
|
||||
|
||||
getConfirmationHeight(): string;
|
||||
setConfirmationHeight(value: string): void;
|
||||
|
||||
getBlocksUntilExpiry(): string;
|
||||
setBlocksUntilExpiry(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): Deposit.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: Deposit): Deposit.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: Deposit, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): Deposit;
|
||||
static deserializeBinaryFromReader(message: Deposit, reader: jspb.BinaryReader): Deposit;
|
||||
}
|
||||
|
||||
export namespace Deposit {
|
||||
export type AsObject = {
|
||||
id: Uint8Array | string,
|
||||
state: DepositStateMap[keyof DepositStateMap],
|
||||
outpoint: string,
|
||||
value: string,
|
||||
confirmationHeight: string,
|
||||
blocksUntilExpiry: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class StaticAddressLoopInSwap extends jspb.Message {
|
||||
getSwapHash(): Uint8Array | string;
|
||||
getSwapHash_asU8(): Uint8Array;
|
||||
getSwapHash_asB64(): string;
|
||||
setSwapHash(value: Uint8Array | string): void;
|
||||
|
||||
clearDepositOutpointsList(): void;
|
||||
getDepositOutpointsList(): Array<string>;
|
||||
setDepositOutpointsList(value: Array<string>): void;
|
||||
addDepositOutpoints(value: string, index?: number): string;
|
||||
|
||||
getState(): StaticAddressLoopInSwapStateMap[keyof StaticAddressLoopInSwapStateMap];
|
||||
setState(value: StaticAddressLoopInSwapStateMap[keyof StaticAddressLoopInSwapStateMap]): void;
|
||||
|
||||
getSwapAmountSatoshis(): string;
|
||||
setSwapAmountSatoshis(value: string): void;
|
||||
|
||||
getPaymentRequestAmountSatoshis(): string;
|
||||
setPaymentRequestAmountSatoshis(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): StaticAddressLoopInSwap.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: StaticAddressLoopInSwap): StaticAddressLoopInSwap.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: StaticAddressLoopInSwap, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): StaticAddressLoopInSwap;
|
||||
static deserializeBinaryFromReader(message: StaticAddressLoopInSwap, reader: jspb.BinaryReader): StaticAddressLoopInSwap;
|
||||
}
|
||||
|
||||
export namespace StaticAddressLoopInSwap {
|
||||
export type AsObject = {
|
||||
swapHash: Uint8Array | string,
|
||||
depositOutpointsList: Array<string>,
|
||||
state: StaticAddressLoopInSwapStateMap[keyof StaticAddressLoopInSwapStateMap],
|
||||
swapAmountSatoshis: string,
|
||||
paymentRequestAmountSatoshis: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class StaticAddressLoopInRequest extends jspb.Message {
|
||||
clearOutpointsList(): void;
|
||||
getOutpointsList(): Array<string>;
|
||||
setOutpointsList(value: Array<string>): void;
|
||||
addOutpoints(value: string, index?: number): string;
|
||||
|
||||
getMaxSwapFeeSatoshis(): string;
|
||||
setMaxSwapFeeSatoshis(value: string): void;
|
||||
|
||||
getLastHop(): Uint8Array | string;
|
||||
getLastHop_asU8(): Uint8Array;
|
||||
getLastHop_asB64(): string;
|
||||
setLastHop(value: Uint8Array | string): void;
|
||||
|
||||
getLabel(): string;
|
||||
setLabel(value: string): void;
|
||||
|
||||
getInitiator(): string;
|
||||
setInitiator(value: string): void;
|
||||
|
||||
clearRouteHintsList(): void;
|
||||
getRouteHintsList(): Array<swapserverrpc_common_pb.RouteHint>;
|
||||
setRouteHintsList(value: Array<swapserverrpc_common_pb.RouteHint>): void;
|
||||
addRouteHints(value?: swapserverrpc_common_pb.RouteHint, index?: number): swapserverrpc_common_pb.RouteHint;
|
||||
|
||||
getPrivate(): boolean;
|
||||
setPrivate(value: boolean): void;
|
||||
|
||||
getPaymentTimeoutSeconds(): number;
|
||||
setPaymentTimeoutSeconds(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): StaticAddressLoopInRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: StaticAddressLoopInRequest): StaticAddressLoopInRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: StaticAddressLoopInRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): StaticAddressLoopInRequest;
|
||||
static deserializeBinaryFromReader(message: StaticAddressLoopInRequest, reader: jspb.BinaryReader): StaticAddressLoopInRequest;
|
||||
}
|
||||
|
||||
export namespace StaticAddressLoopInRequest {
|
||||
export type AsObject = {
|
||||
outpointsList: Array<string>,
|
||||
maxSwapFeeSatoshis: string,
|
||||
lastHop: Uint8Array | string,
|
||||
label: string,
|
||||
initiator: string,
|
||||
routeHintsList: Array<swapserverrpc_common_pb.RouteHint.AsObject>,
|
||||
pb_private: boolean,
|
||||
paymentTimeoutSeconds: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class StaticAddressLoopInResponse extends jspb.Message {
|
||||
getSwapHash(): Uint8Array | string;
|
||||
getSwapHash_asU8(): Uint8Array;
|
||||
getSwapHash_asB64(): string;
|
||||
setSwapHash(value: Uint8Array | string): void;
|
||||
|
||||
getState(): string;
|
||||
setState(value: string): void;
|
||||
|
||||
getAmount(): string;
|
||||
setAmount(value: string): void;
|
||||
|
||||
getHtlcCltv(): number;
|
||||
setHtlcCltv(value: number): void;
|
||||
|
||||
getQuotedSwapFeeSatoshis(): string;
|
||||
setQuotedSwapFeeSatoshis(value: string): void;
|
||||
|
||||
getMaxSwapFeeSatoshis(): string;
|
||||
setMaxSwapFeeSatoshis(value: string): void;
|
||||
|
||||
getInitiationHeight(): number;
|
||||
setInitiationHeight(value: number): void;
|
||||
|
||||
getProtocolVersion(): string;
|
||||
setProtocolVersion(value: string): void;
|
||||
|
||||
getLabel(): string;
|
||||
setLabel(value: string): void;
|
||||
|
||||
getInitiator(): string;
|
||||
setInitiator(value: string): void;
|
||||
|
||||
getPaymentTimeoutSeconds(): number;
|
||||
setPaymentTimeoutSeconds(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): StaticAddressLoopInResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: StaticAddressLoopInResponse): StaticAddressLoopInResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: StaticAddressLoopInResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): StaticAddressLoopInResponse;
|
||||
static deserializeBinaryFromReader(message: StaticAddressLoopInResponse, reader: jspb.BinaryReader): StaticAddressLoopInResponse;
|
||||
}
|
||||
|
||||
export namespace StaticAddressLoopInResponse {
|
||||
export type AsObject = {
|
||||
swapHash: Uint8Array | string,
|
||||
state: string,
|
||||
amount: string,
|
||||
htlcCltv: number,
|
||||
quotedSwapFeeSatoshis: string,
|
||||
maxSwapFeeSatoshis: string,
|
||||
initiationHeight: number,
|
||||
protocolVersion: string,
|
||||
label: string,
|
||||
initiator: string,
|
||||
paymentTimeoutSeconds: number,
|
||||
}
|
||||
}
|
||||
|
||||
export interface AddressTypeMap {
|
||||
ADDRESS_TYPE_UNKNOWN: 0;
|
||||
TAPROOT_PUBKEY: 1;
|
||||
|
|
@ -1536,3 +2138,36 @@ export interface AutoReasonMap {
|
|||
|
||||
export const AutoReason: AutoReasonMap;
|
||||
|
||||
export interface DepositStateMap {
|
||||
UNKNOWN_STATE: 0;
|
||||
DEPOSITED: 1;
|
||||
WITHDRAWING: 2;
|
||||
WITHDRAWN: 3;
|
||||
LOOPING_IN: 4;
|
||||
LOOPED_IN: 5;
|
||||
SWEEP_HTLC_TIMEOUT: 6;
|
||||
HTLC_TIMEOUT_SWEPT: 7;
|
||||
PUBLISH_EXPIRED: 8;
|
||||
WAIT_FOR_EXPIRY_SWEEP: 9;
|
||||
EXPIRED: 10;
|
||||
}
|
||||
|
||||
export const DepositState: DepositStateMap;
|
||||
|
||||
export interface StaticAddressLoopInSwapStateMap {
|
||||
UNKNOWN_STATIC_ADDRESS_SWAP_STATE: 0;
|
||||
INIT_HTLC: 1;
|
||||
SIGN_HTLC_TX: 2;
|
||||
MONITOR_INVOICE_HTLC_TX: 3;
|
||||
PAYMENT_RECEIVED: 4;
|
||||
SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT: 5;
|
||||
MONITOR_HTLC_TIMEOUT_SWEEP: 6;
|
||||
HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT: 7;
|
||||
SUCCEEDED: 8;
|
||||
SUCCEEDED_TRANSITIONING_FAILED: 9;
|
||||
UNLOCK_DEPOSITS: 10;
|
||||
FAILED_STATIC_ADDRESS_SWAP: 11;
|
||||
}
|
||||
|
||||
export const StaticAddressLoopInSwapState: StaticAddressLoopInSwapStateMap;
|
||||
|
||||
|
|
|
|||
4759
app/src/types/generated/loop_pb.js
generated
4759
app/src/types/generated/loop_pb.js
generated
File diff suppressed because it is too large
Load diff
152
app/src/types/generated/loop_pb_service.d.ts
generated
vendored
152
app/src/types/generated/loop_pb_service.d.ts
generated
vendored
|
|
@ -121,6 +121,15 @@ type SwapClientGetLsatTokens = {
|
|||
readonly responseType: typeof loop_pb.TokensResponse;
|
||||
};
|
||||
|
||||
type SwapClientFetchL402Token = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.FetchL402TokenRequest;
|
||||
readonly responseType: typeof loop_pb.FetchL402TokenResponse;
|
||||
};
|
||||
|
||||
type SwapClientGetInfo = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
|
|
@ -193,6 +202,69 @@ type SwapClientListInstantOuts = {
|
|||
readonly responseType: typeof loop_pb.ListInstantOutsResponse;
|
||||
};
|
||||
|
||||
type SwapClientNewStaticAddress = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.NewStaticAddressRequest;
|
||||
readonly responseType: typeof loop_pb.NewStaticAddressResponse;
|
||||
};
|
||||
|
||||
type SwapClientListUnspentDeposits = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.ListUnspentDepositsRequest;
|
||||
readonly responseType: typeof loop_pb.ListUnspentDepositsResponse;
|
||||
};
|
||||
|
||||
type SwapClientWithdrawDeposits = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.WithdrawDepositsRequest;
|
||||
readonly responseType: typeof loop_pb.WithdrawDepositsResponse;
|
||||
};
|
||||
|
||||
type SwapClientListStaticAddressDeposits = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.ListStaticAddressDepositsRequest;
|
||||
readonly responseType: typeof loop_pb.ListStaticAddressDepositsResponse;
|
||||
};
|
||||
|
||||
type SwapClientListStaticAddressSwaps = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.ListStaticAddressSwapsRequest;
|
||||
readonly responseType: typeof loop_pb.ListStaticAddressSwapsResponse;
|
||||
};
|
||||
|
||||
type SwapClientGetStaticAddressSummary = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.StaticAddressSummaryRequest;
|
||||
readonly responseType: typeof loop_pb.StaticAddressSummaryResponse;
|
||||
};
|
||||
|
||||
type SwapClientStaticAddressLoopIn = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof SwapClient;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof loop_pb.StaticAddressLoopInRequest;
|
||||
readonly responseType: typeof loop_pb.StaticAddressLoopInResponse;
|
||||
};
|
||||
|
||||
export class SwapClient {
|
||||
static readonly serviceName: string;
|
||||
static readonly LoopOut: SwapClientLoopOut;
|
||||
|
|
@ -208,6 +280,7 @@ export class SwapClient {
|
|||
static readonly Probe: SwapClientProbe;
|
||||
static readonly GetL402Tokens: SwapClientGetL402Tokens;
|
||||
static readonly GetLsatTokens: SwapClientGetLsatTokens;
|
||||
static readonly FetchL402Token: SwapClientFetchL402Token;
|
||||
static readonly GetInfo: SwapClientGetInfo;
|
||||
static readonly GetLiquidityParams: SwapClientGetLiquidityParams;
|
||||
static readonly SetLiquidityParams: SwapClientSetLiquidityParams;
|
||||
|
|
@ -216,6 +289,13 @@ export class SwapClient {
|
|||
static readonly InstantOut: SwapClientInstantOut;
|
||||
static readonly InstantOutQuote: SwapClientInstantOutQuote;
|
||||
static readonly ListInstantOuts: SwapClientListInstantOuts;
|
||||
static readonly NewStaticAddress: SwapClientNewStaticAddress;
|
||||
static readonly ListUnspentDeposits: SwapClientListUnspentDeposits;
|
||||
static readonly WithdrawDeposits: SwapClientWithdrawDeposits;
|
||||
static readonly ListStaticAddressDeposits: SwapClientListStaticAddressDeposits;
|
||||
static readonly ListStaticAddressSwaps: SwapClientListStaticAddressSwaps;
|
||||
static readonly GetStaticAddressSummary: SwapClientGetStaticAddressSummary;
|
||||
static readonly StaticAddressLoopIn: SwapClientStaticAddressLoopIn;
|
||||
}
|
||||
|
||||
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
||||
|
|
@ -359,6 +439,15 @@ export class SwapClientClient {
|
|||
requestMessage: loop_pb.TokensRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.TokensResponse|null) => void
|
||||
): UnaryResponse;
|
||||
fetchL402Token(
|
||||
requestMessage: loop_pb.FetchL402TokenRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.FetchL402TokenResponse|null) => void
|
||||
): UnaryResponse;
|
||||
fetchL402Token(
|
||||
requestMessage: loop_pb.FetchL402TokenRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.FetchL402TokenResponse|null) => void
|
||||
): UnaryResponse;
|
||||
getInfo(
|
||||
requestMessage: loop_pb.GetInfoRequest,
|
||||
metadata: grpc.Metadata,
|
||||
|
|
@ -431,5 +520,68 @@ export class SwapClientClient {
|
|||
requestMessage: loop_pb.ListInstantOutsRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListInstantOutsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
newStaticAddress(
|
||||
requestMessage: loop_pb.NewStaticAddressRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.NewStaticAddressResponse|null) => void
|
||||
): UnaryResponse;
|
||||
newStaticAddress(
|
||||
requestMessage: loop_pb.NewStaticAddressRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.NewStaticAddressResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listUnspentDeposits(
|
||||
requestMessage: loop_pb.ListUnspentDepositsRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListUnspentDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listUnspentDeposits(
|
||||
requestMessage: loop_pb.ListUnspentDepositsRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListUnspentDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
withdrawDeposits(
|
||||
requestMessage: loop_pb.WithdrawDepositsRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.WithdrawDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
withdrawDeposits(
|
||||
requestMessage: loop_pb.WithdrawDepositsRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.WithdrawDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listStaticAddressDeposits(
|
||||
requestMessage: loop_pb.ListStaticAddressDepositsRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListStaticAddressDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listStaticAddressDeposits(
|
||||
requestMessage: loop_pb.ListStaticAddressDepositsRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListStaticAddressDepositsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listStaticAddressSwaps(
|
||||
requestMessage: loop_pb.ListStaticAddressSwapsRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListStaticAddressSwapsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
listStaticAddressSwaps(
|
||||
requestMessage: loop_pb.ListStaticAddressSwapsRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.ListStaticAddressSwapsResponse|null) => void
|
||||
): UnaryResponse;
|
||||
getStaticAddressSummary(
|
||||
requestMessage: loop_pb.StaticAddressSummaryRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.StaticAddressSummaryResponse|null) => void
|
||||
): UnaryResponse;
|
||||
getStaticAddressSummary(
|
||||
requestMessage: loop_pb.StaticAddressSummaryRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.StaticAddressSummaryResponse|null) => void
|
||||
): UnaryResponse;
|
||||
staticAddressLoopIn(
|
||||
requestMessage: loop_pb.StaticAddressLoopInRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.StaticAddressLoopInResponse|null) => void
|
||||
): UnaryResponse;
|
||||
staticAddressLoopIn(
|
||||
requestMessage: loop_pb.StaticAddressLoopInRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: loop_pb.StaticAddressLoopInResponse|null) => void
|
||||
): UnaryResponse;
|
||||
}
|
||||
|
||||
|
|
|
|||
320
app/src/types/generated/loop_pb_service.js
generated
320
app/src/types/generated/loop_pb_service.js
generated
|
|
@ -127,6 +127,15 @@ SwapClient.GetLsatTokens = {
|
|||
responseType: loop_pb.TokensResponse
|
||||
};
|
||||
|
||||
SwapClient.FetchL402Token = {
|
||||
methodName: "FetchL402Token",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.FetchL402TokenRequest,
|
||||
responseType: loop_pb.FetchL402TokenResponse
|
||||
};
|
||||
|
||||
SwapClient.GetInfo = {
|
||||
methodName: "GetInfo",
|
||||
service: SwapClient,
|
||||
|
|
@ -199,6 +208,69 @@ SwapClient.ListInstantOuts = {
|
|||
responseType: loop_pb.ListInstantOutsResponse
|
||||
};
|
||||
|
||||
SwapClient.NewStaticAddress = {
|
||||
methodName: "NewStaticAddress",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.NewStaticAddressRequest,
|
||||
responseType: loop_pb.NewStaticAddressResponse
|
||||
};
|
||||
|
||||
SwapClient.ListUnspentDeposits = {
|
||||
methodName: "ListUnspentDeposits",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.ListUnspentDepositsRequest,
|
||||
responseType: loop_pb.ListUnspentDepositsResponse
|
||||
};
|
||||
|
||||
SwapClient.WithdrawDeposits = {
|
||||
methodName: "WithdrawDeposits",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.WithdrawDepositsRequest,
|
||||
responseType: loop_pb.WithdrawDepositsResponse
|
||||
};
|
||||
|
||||
SwapClient.ListStaticAddressDeposits = {
|
||||
methodName: "ListStaticAddressDeposits",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.ListStaticAddressDepositsRequest,
|
||||
responseType: loop_pb.ListStaticAddressDepositsResponse
|
||||
};
|
||||
|
||||
SwapClient.ListStaticAddressSwaps = {
|
||||
methodName: "ListStaticAddressSwaps",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.ListStaticAddressSwapsRequest,
|
||||
responseType: loop_pb.ListStaticAddressSwapsResponse
|
||||
};
|
||||
|
||||
SwapClient.GetStaticAddressSummary = {
|
||||
methodName: "GetStaticAddressSummary",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.StaticAddressSummaryRequest,
|
||||
responseType: loop_pb.StaticAddressSummaryResponse
|
||||
};
|
||||
|
||||
SwapClient.StaticAddressLoopIn = {
|
||||
methodName: "StaticAddressLoopIn",
|
||||
service: SwapClient,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: loop_pb.StaticAddressLoopInRequest,
|
||||
responseType: loop_pb.StaticAddressLoopInResponse
|
||||
};
|
||||
|
||||
exports.SwapClient = SwapClient;
|
||||
|
||||
function SwapClientClient(serviceHost, options) {
|
||||
|
|
@ -617,6 +689,37 @@ SwapClientClient.prototype.getLsatTokens = function getLsatTokens(requestMessage
|
|||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.fetchL402Token = function fetchL402Token(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.FetchL402Token, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.getInfo = function getInfo(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
|
|
@ -865,5 +968,222 @@ SwapClientClient.prototype.listInstantOuts = function listInstantOuts(requestMes
|
|||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.newStaticAddress = function newStaticAddress(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.NewStaticAddress, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.listUnspentDeposits = function listUnspentDeposits(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.ListUnspentDeposits, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.withdrawDeposits = function withdrawDeposits(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.WithdrawDeposits, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.listStaticAddressDeposits = function listStaticAddressDeposits(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.ListStaticAddressDeposits, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.listStaticAddressSwaps = function listStaticAddressSwaps(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.ListStaticAddressSwaps, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.getStaticAddressSummary = function getStaticAddressSummary(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.GetStaticAddressSummary, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SwapClientClient.prototype.staticAddressLoopIn = function staticAddressLoopIn(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(SwapClient.StaticAddressLoopIn, {
|
||||
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.SwapClientClient = SwapClientClient;
|
||||
|
||||
|
|
|
|||
172
app/src/types/generated/swapserverrpc/server_pb.d.ts
generated
vendored
172
app/src/types/generated/swapserverrpc/server_pb.d.ts
generated
vendored
|
|
@ -1073,6 +1073,11 @@ export class SubscribeNotificationsResponse extends jspb.Message {
|
|||
getReservationNotification(): swapserverrpc_reservation_pb.ServerReservationNotification | undefined;
|
||||
setReservationNotification(value?: swapserverrpc_reservation_pb.ServerReservationNotification): void;
|
||||
|
||||
hasStaticLoopInSweep(): boolean;
|
||||
clearStaticLoopInSweep(): void;
|
||||
getStaticLoopInSweep(): ServerStaticLoopInSweepNotification | undefined;
|
||||
setStaticLoopInSweep(value?: ServerStaticLoopInSweepNotification): void;
|
||||
|
||||
getNotificationCase(): SubscribeNotificationsResponse.NotificationCase;
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SubscribeNotificationsResponse.AsObject;
|
||||
|
|
@ -1087,155 +1092,50 @@ export class SubscribeNotificationsResponse extends jspb.Message {
|
|||
export namespace SubscribeNotificationsResponse {
|
||||
export type AsObject = {
|
||||
reservationNotification?: swapserverrpc_reservation_pb.ServerReservationNotification.AsObject,
|
||||
staticLoopInSweep?: ServerStaticLoopInSweepNotification.AsObject,
|
||||
}
|
||||
|
||||
export enum NotificationCase {
|
||||
NOTIFICATION_NOT_SET = 0,
|
||||
RESERVATION_NOTIFICATION = 1,
|
||||
STATIC_LOOP_IN_SWEEP = 2,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerNewAddressRequest extends jspb.Message {
|
||||
getProtocolVersion(): StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap];
|
||||
setProtocolVersion(value: StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap]): void;
|
||||
export class ServerStaticLoopInSweepNotification extends jspb.Message {
|
||||
getSweepTxPsbt(): Uint8Array | string;
|
||||
getSweepTxPsbt_asU8(): Uint8Array;
|
||||
getSweepTxPsbt_asB64(): string;
|
||||
setSweepTxPsbt(value: Uint8Array | string): void;
|
||||
|
||||
getClientKey(): Uint8Array | string;
|
||||
getClientKey_asU8(): Uint8Array;
|
||||
getClientKey_asB64(): string;
|
||||
setClientKey(value: Uint8Array | string): void;
|
||||
getSwapHash(): Uint8Array | string;
|
||||
getSwapHash_asU8(): Uint8Array;
|
||||
getSwapHash_asB64(): string;
|
||||
setSwapHash(value: Uint8Array | string): void;
|
||||
|
||||
getDepositToNoncesMap(): jspb.Map<string, Uint8Array | string>;
|
||||
clearDepositToNoncesMap(): void;
|
||||
clearPrevoutInfoList(): void;
|
||||
getPrevoutInfoList(): Array<PrevoutInfo>;
|
||||
setPrevoutInfoList(value: Array<PrevoutInfo>): void;
|
||||
addPrevoutInfo(value?: PrevoutInfo, index?: number): PrevoutInfo;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerNewAddressRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerNewAddressRequest): ServerNewAddressRequest.AsObject;
|
||||
toObject(includeInstance?: boolean): ServerStaticLoopInSweepNotification.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerStaticLoopInSweepNotification): ServerStaticLoopInSweepNotification.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerNewAddressRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerNewAddressRequest;
|
||||
static deserializeBinaryFromReader(message: ServerNewAddressRequest, reader: jspb.BinaryReader): ServerNewAddressRequest;
|
||||
static serializeBinaryToWriter(message: ServerStaticLoopInSweepNotification, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerStaticLoopInSweepNotification;
|
||||
static deserializeBinaryFromReader(message: ServerStaticLoopInSweepNotification, reader: jspb.BinaryReader): ServerStaticLoopInSweepNotification;
|
||||
}
|
||||
|
||||
export namespace ServerNewAddressRequest {
|
||||
export namespace ServerStaticLoopInSweepNotification {
|
||||
export type AsObject = {
|
||||
protocolVersion: StaticAddressProtocolVersionMap[keyof StaticAddressProtocolVersionMap],
|
||||
clientKey: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerNewAddressResponse extends jspb.Message {
|
||||
hasParams(): boolean;
|
||||
clearParams(): void;
|
||||
getParams(): ServerAddressParameters | undefined;
|
||||
setParams(value?: ServerAddressParameters): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerNewAddressResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerNewAddressResponse): ServerNewAddressResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerNewAddressResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerNewAddressResponse;
|
||||
static deserializeBinaryFromReader(message: ServerNewAddressResponse, reader: jspb.BinaryReader): ServerNewAddressResponse;
|
||||
}
|
||||
|
||||
export namespace ServerNewAddressResponse {
|
||||
export type AsObject = {
|
||||
params?: ServerAddressParameters.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerAddressParameters extends jspb.Message {
|
||||
getServerKey(): Uint8Array | string;
|
||||
getServerKey_asU8(): Uint8Array;
|
||||
getServerKey_asB64(): string;
|
||||
setServerKey(value: Uint8Array | string): void;
|
||||
|
||||
getExpiry(): number;
|
||||
setExpiry(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerAddressParameters.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerAddressParameters): ServerAddressParameters.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerAddressParameters, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerAddressParameters;
|
||||
static deserializeBinaryFromReader(message: ServerAddressParameters, reader: jspb.BinaryReader): ServerAddressParameters;
|
||||
}
|
||||
|
||||
export namespace ServerAddressParameters {
|
||||
export type AsObject = {
|
||||
serverKey: Uint8Array | string,
|
||||
expiry: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerWithdrawRequest extends jspb.Message {
|
||||
clearOutpointsList(): void;
|
||||
getOutpointsList(): Array<PrevoutInfo>;
|
||||
setOutpointsList(value: Array<PrevoutInfo>): void;
|
||||
addOutpoints(value?: PrevoutInfo, index?: number): PrevoutInfo;
|
||||
|
||||
clearClientNoncesList(): void;
|
||||
getClientNoncesList(): Array<Uint8Array | string>;
|
||||
getClientNoncesList_asU8(): Array<Uint8Array>;
|
||||
getClientNoncesList_asB64(): Array<string>;
|
||||
setClientNoncesList(value: Array<Uint8Array | string>): void;
|
||||
addClientNonces(value: Uint8Array | string, index?: number): Uint8Array | string;
|
||||
|
||||
getClientSweepAddr(): string;
|
||||
setClientSweepAddr(value: string): void;
|
||||
|
||||
getTxFeeRate(): string;
|
||||
setTxFeeRate(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerWithdrawRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerWithdrawRequest): ServerWithdrawRequest.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerWithdrawRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerWithdrawRequest;
|
||||
static deserializeBinaryFromReader(message: ServerWithdrawRequest, reader: jspb.BinaryReader): ServerWithdrawRequest;
|
||||
}
|
||||
|
||||
export namespace ServerWithdrawRequest {
|
||||
export type AsObject = {
|
||||
outpointsList: Array<PrevoutInfo.AsObject>,
|
||||
clientNoncesList: Array<Uint8Array | string>,
|
||||
clientSweepAddr: string,
|
||||
txFeeRate: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerWithdrawResponse extends jspb.Message {
|
||||
clearMusig2SweepSigsList(): void;
|
||||
getMusig2SweepSigsList(): Array<Uint8Array | string>;
|
||||
getMusig2SweepSigsList_asU8(): Array<Uint8Array>;
|
||||
getMusig2SweepSigsList_asB64(): Array<string>;
|
||||
setMusig2SweepSigsList(value: Array<Uint8Array | string>): void;
|
||||
addMusig2SweepSigs(value: Uint8Array | string, index?: number): Uint8Array | string;
|
||||
|
||||
clearServerNoncesList(): void;
|
||||
getServerNoncesList(): Array<Uint8Array | string>;
|
||||
getServerNoncesList_asU8(): Array<Uint8Array>;
|
||||
getServerNoncesList_asB64(): Array<string>;
|
||||
setServerNoncesList(value: Array<Uint8Array | string>): void;
|
||||
addServerNonces(value: Uint8Array | string, index?: number): Uint8Array | string;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerWithdrawResponse.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerWithdrawResponse): ServerWithdrawResponse.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerWithdrawResponse, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerWithdrawResponse;
|
||||
static deserializeBinaryFromReader(message: ServerWithdrawResponse, reader: jspb.BinaryReader): ServerWithdrawResponse;
|
||||
}
|
||||
|
||||
export namespace ServerWithdrawResponse {
|
||||
export type AsObject = {
|
||||
musig2SweepSigsList: Array<Uint8Array | string>,
|
||||
serverNoncesList: Array<Uint8Array | string>,
|
||||
sweepTxPsbt: Uint8Array | string,
|
||||
swapHash: Uint8Array | string,
|
||||
depositToNoncesMap: Array<[string, Uint8Array | string]>,
|
||||
prevoutInfoList: Array<PrevoutInfo.AsObject>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1304,9 +1204,3 @@ export interface RoutingPluginMap {
|
|||
|
||||
export const RoutingPlugin: RoutingPluginMap;
|
||||
|
||||
export interface StaticAddressProtocolVersionMap {
|
||||
V0: 0;
|
||||
}
|
||||
|
||||
export const StaticAddressProtocolVersion: StaticAddressProtocolVersionMap;
|
||||
|
||||
|
|
|
|||
1205
app/src/types/generated/swapserverrpc/server_pb.js
generated
1205
app/src/types/generated/swapserverrpc/server_pb.js
generated
File diff suppressed because it is too large
Load diff
48
app/src/types/generated/swapserverrpc/server_pb_service.d.ts
generated
vendored
48
app/src/types/generated/swapserverrpc/server_pb_service.d.ts
generated
vendored
|
|
@ -178,30 +178,6 @@ export class SwapServer {
|
|||
static readonly SubscribeNotifications: SwapServerSubscribeNotifications;
|
||||
}
|
||||
|
||||
type StaticAddressServerServerNewAddress = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof StaticAddressServer;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof swapserverrpc_server_pb.ServerNewAddressRequest;
|
||||
readonly responseType: typeof swapserverrpc_server_pb.ServerNewAddressResponse;
|
||||
};
|
||||
|
||||
type StaticAddressServerServerWithdrawDeposits = {
|
||||
readonly methodName: string;
|
||||
readonly service: typeof StaticAddressServer;
|
||||
readonly requestStream: false;
|
||||
readonly responseStream: false;
|
||||
readonly requestType: typeof swapserverrpc_server_pb.ServerWithdrawRequest;
|
||||
readonly responseType: typeof swapserverrpc_server_pb.ServerWithdrawResponse;
|
||||
};
|
||||
|
||||
export class StaticAddressServer {
|
||||
static readonly serviceName: string;
|
||||
static readonly ServerNewAddress: StaticAddressServerServerNewAddress;
|
||||
static readonly ServerWithdrawDeposits: StaticAddressServerServerWithdrawDeposits;
|
||||
}
|
||||
|
||||
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
||||
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
||||
|
||||
|
|
@ -365,27 +341,3 @@ export class SwapServerClient {
|
|||
subscribeNotifications(requestMessage: swapserverrpc_server_pb.SubscribeNotificationsRequest, metadata?: grpc.Metadata): ResponseStream<swapserverrpc_server_pb.SubscribeNotificationsResponse>;
|
||||
}
|
||||
|
||||
export class StaticAddressServerClient {
|
||||
readonly serviceHost: string;
|
||||
|
||||
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
||||
serverNewAddress(
|
||||
requestMessage: swapserverrpc_server_pb.ServerNewAddressRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerNewAddressResponse|null) => void
|
||||
): UnaryResponse;
|
||||
serverNewAddress(
|
||||
requestMessage: swapserverrpc_server_pb.ServerNewAddressRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerNewAddressResponse|null) => void
|
||||
): UnaryResponse;
|
||||
serverWithdrawDeposits(
|
||||
requestMessage: swapserverrpc_server_pb.ServerWithdrawRequest,
|
||||
metadata: grpc.Metadata,
|
||||
callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerWithdrawResponse|null) => void
|
||||
): UnaryResponse;
|
||||
serverWithdrawDeposits(
|
||||
requestMessage: swapserverrpc_server_pb.ServerWithdrawRequest,
|
||||
callback: (error: ServiceError|null, responseMessage: swapserverrpc_server_pb.ServerWithdrawResponse|null) => void
|
||||
): UnaryResponse;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -723,98 +723,3 @@ SwapServerClient.prototype.subscribeNotifications = function subscribeNotificati
|
|||
|
||||
exports.SwapServerClient = SwapServerClient;
|
||||
|
||||
var StaticAddressServer = (function () {
|
||||
function StaticAddressServer() {}
|
||||
StaticAddressServer.serviceName = "looprpc.StaticAddressServer";
|
||||
return StaticAddressServer;
|
||||
}());
|
||||
|
||||
StaticAddressServer.ServerNewAddress = {
|
||||
methodName: "ServerNewAddress",
|
||||
service: StaticAddressServer,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: swapserverrpc_server_pb.ServerNewAddressRequest,
|
||||
responseType: swapserverrpc_server_pb.ServerNewAddressResponse
|
||||
};
|
||||
|
||||
StaticAddressServer.ServerWithdrawDeposits = {
|
||||
methodName: "ServerWithdrawDeposits",
|
||||
service: StaticAddressServer,
|
||||
requestStream: false,
|
||||
responseStream: false,
|
||||
requestType: swapserverrpc_server_pb.ServerWithdrawRequest,
|
||||
responseType: swapserverrpc_server_pb.ServerWithdrawResponse
|
||||
};
|
||||
|
||||
exports.StaticAddressServer = StaticAddressServer;
|
||||
|
||||
function StaticAddressServerClient(serviceHost, options) {
|
||||
this.serviceHost = serviceHost;
|
||||
this.options = options || {};
|
||||
}
|
||||
|
||||
StaticAddressServerClient.prototype.serverNewAddress = function serverNewAddress(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(StaticAddressServer.ServerNewAddress, {
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
StaticAddressServerClient.prototype.serverWithdrawDeposits = function serverWithdrawDeposits(requestMessage, metadata, callback) {
|
||||
if (arguments.length === 2) {
|
||||
callback = arguments[1];
|
||||
}
|
||||
var client = grpc.unary(StaticAddressServer.ServerWithdrawDeposits, {
|
||||
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.StaticAddressServerClient = StaticAddressServerClient;
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export const lndGetNodeInfo: Required<LND.NodeInfo.AsObject> = {
|
|||
export const lndChannelBalance: LND.ChannelBalanceResponse.AsObject = {
|
||||
balance: '9990950',
|
||||
pendingOpenBalance: '0',
|
||||
customChannelData: '',
|
||||
};
|
||||
|
||||
export const lndWalletBalance: LND.WalletBalanceResponse.AsObject = {
|
||||
|
|
@ -132,6 +133,7 @@ export const lndChannel: LND.Channel.AsObject = {
|
|||
peerAlias: '',
|
||||
peerScidAlias: '',
|
||||
memo: 'test channel',
|
||||
customChannelData: '',
|
||||
};
|
||||
|
||||
export const lndListChannelsMany: LND.ListChannelsResponse.AsObject = {
|
||||
|
|
@ -172,6 +174,7 @@ export const lndPendingChannel: LND.PendingChannelsResponse.PendingChannel.AsObj
|
|||
chanStatusFlags: 'ChanStatusDefault',
|
||||
pb_private: false,
|
||||
memo: 'test channel',
|
||||
customChannelData: '',
|
||||
};
|
||||
|
||||
export const lndPendingChannels: LND.PendingChannelsResponse.AsObject = {
|
||||
|
|
|
|||
718
cmd/litcli/ln.go
Normal file
718
cmd/litcli/ln.go
Normal file
|
|
@ -0,0 +1,718 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/lightninglabs/taproot-assets/asset"
|
||||
"github.com/lightninglabs/taproot-assets/rfq"
|
||||
"github.com/lightninglabs/taproot-assets/rfqmath"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
|
||||
tchrpc "github.com/lightninglabs/taproot-assets/taprpc/tapchannelrpc"
|
||||
"github.com/lightningnetwork/lnd/cmd/commands"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
"github.com/urfave/cli"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
const (
|
||||
// minAssetAmount is the minimum amount of an asset that can be put into
|
||||
// a channel. We choose an arbitrary value that allows for at least a
|
||||
// couple of HTLCs to be created without leading to fractions of assets
|
||||
// (which doesn't exist).
|
||||
minAssetAmount = 100
|
||||
)
|
||||
|
||||
var lnCommands = []cli.Command{
|
||||
{
|
||||
Name: "ln",
|
||||
Usage: "Interact with the Lightning Network.",
|
||||
Category: "Taproot Assets on LN",
|
||||
Subcommands: []cli.Command{
|
||||
fundChannelCommand,
|
||||
sendPaymentCommand,
|
||||
payInvoiceCommand,
|
||||
addInvoiceCommand,
|
||||
decodeAssetInvoiceCommand,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var fundChannelCommand = cli.Command{
|
||||
Name: "fundchannel",
|
||||
Category: "Channels",
|
||||
Usage: "Open a Taproot Asset channel with a node on the Lightning " +
|
||||
"Network.",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "node_key",
|
||||
Usage: "the identity public key of the target " +
|
||||
"node/peer serialized in compressed format, " +
|
||||
"must already be connected to",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "sat_per_vbyte",
|
||||
Usage: "(optional) a manual fee expressed in " +
|
||||
"sat/vByte that should be used when crafting " +
|
||||
"the transaction",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "push_amt",
|
||||
Usage: "the number of satoshis to give the remote " +
|
||||
"side as part of the initial commitment " +
|
||||
"state, this is equivalent to first opening " +
|
||||
"a channel and then sending the remote party " +
|
||||
"funds, but done all in one step; therefore, " +
|
||||
"this is equivalent to a donation to the " +
|
||||
"remote party, unless they reimburse the " +
|
||||
"funds in another way (outside the protocol)",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "asset_amount",
|
||||
Usage: "The amount of the asset to commit to the " +
|
||||
"channel.",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "asset_id",
|
||||
Usage: "The asset ID to commit to the channel.",
|
||||
},
|
||||
},
|
||||
Action: fundChannel,
|
||||
}
|
||||
|
||||
func fundChannel(c *cli.Context) error {
|
||||
tapdConn, cleanup, err := connectSuperMacClient(c)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating tapd connection: %w", err)
|
||||
}
|
||||
|
||||
defer cleanup()
|
||||
|
||||
ctxb := context.Background()
|
||||
tapdClient := taprpc.NewTaprootAssetsClient(tapdConn)
|
||||
tchrpcClient := tchrpc.NewTaprootAssetChannelsClient(tapdConn)
|
||||
assets, err := tapdClient.ListAssets(ctxb, &taprpc.ListAssetRequest{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error fetching assets: %w", err)
|
||||
}
|
||||
|
||||
assetIDBytes, err := hex.DecodeString(c.String("asset_id"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("error hex decoding asset ID: %w", err)
|
||||
}
|
||||
|
||||
requestedAmount := c.Uint64("asset_amount")
|
||||
if requestedAmount < minAssetAmount {
|
||||
return fmt.Errorf("requested amount must be at least %d",
|
||||
minAssetAmount)
|
||||
}
|
||||
|
||||
nodePubBytes, err := hex.DecodeString(c.String("node_key"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode node public key: %w", err)
|
||||
}
|
||||
|
||||
assetFound := false
|
||||
totalAmount := uint64(0)
|
||||
for _, rpcAsset := range assets.Assets {
|
||||
if !bytes.Equal(rpcAsset.AssetGenesis.AssetId, assetIDBytes) {
|
||||
continue
|
||||
}
|
||||
|
||||
totalAmount += rpcAsset.Amount
|
||||
if totalAmount >= requestedAmount {
|
||||
assetFound = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
assetFound = true
|
||||
}
|
||||
|
||||
if !assetFound {
|
||||
return fmt.Errorf("asset with ID %x not found or no combined "+
|
||||
"UTXOs with at least amount %d is available",
|
||||
assetIDBytes, requestedAmount)
|
||||
}
|
||||
|
||||
resp, err := tchrpcClient.FundChannel(
|
||||
ctxb, &tchrpc.FundChannelRequest{
|
||||
AssetAmount: requestedAmount,
|
||||
AssetId: assetIDBytes,
|
||||
PeerPubkey: nodePubBytes,
|
||||
FeeRateSatPerVbyte: uint32(c.Uint64("sat_per_vbyte")),
|
||||
PushSat: c.Int64("push_amt"),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error funding channel: %w", err)
|
||||
}
|
||||
|
||||
printJSON(resp)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
assetIDFlag = cli.StringFlag{
|
||||
Name: "asset_id",
|
||||
Usage: "the asset ID of the asset to use when sending " +
|
||||
"payments with assets",
|
||||
}
|
||||
|
||||
assetAmountFlag = cli.Uint64Flag{
|
||||
Name: "asset_amount",
|
||||
Usage: "the amount of the asset to send in the asset keysend " +
|
||||
"payment",
|
||||
}
|
||||
|
||||
rfqPeerPubKeyFlag = cli.StringFlag{
|
||||
Name: "rfq_peer_pubkey",
|
||||
Usage: "(optional) the public key of the peer to ask for a " +
|
||||
"quote when converting from assets to sats; must be " +
|
||||
"set if there are multiple channels with the same " +
|
||||
"asset ID present",
|
||||
}
|
||||
|
||||
allowOverpayFlag = cli.BoolFlag{
|
||||
Name: "allow_overpay",
|
||||
Usage: "allow sending asset payments that are uneconomical " +
|
||||
"because the required non-dust amount for an asset " +
|
||||
"carrier HTLC plus one asset unit is higher than the " +
|
||||
"total invoice/payment amount that arrives at the " +
|
||||
"destination; meaning that the total amount sent " +
|
||||
"exceeds the total amount received plus routing fees",
|
||||
}
|
||||
)
|
||||
|
||||
// resultStreamWrapper is a wrapper around the SendPaymentClient stream that
|
||||
// implements the generic PaymentResultStream interface.
|
||||
type resultStreamWrapper struct {
|
||||
amountMsat int64
|
||||
stream tchrpc.TaprootAssetChannels_SendPaymentClient
|
||||
}
|
||||
|
||||
// Recv receives the next payment result from the stream.
|
||||
//
|
||||
// NOTE: This method is part of the PaymentResultStream interface.
|
||||
func (w *resultStreamWrapper) Recv() (*lnrpc.Payment, error) {
|
||||
resp, err := w.stream.Recv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res := resp.Result
|
||||
switch r := res.(type) {
|
||||
// The very first response might be an accepted sell order, which we
|
||||
// just print out.
|
||||
case *tchrpc.SendPaymentResponse_AcceptedSellOrder:
|
||||
quote := r.AcceptedSellOrder
|
||||
rpcRate := quote.BidAssetRate
|
||||
rate, err := rfqrpc.UnmarshalFixedPoint(rpcRate)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to unmarshal fixed "+
|
||||
"point: %w", err)
|
||||
}
|
||||
|
||||
amountMsat := lnwire.MilliSatoshi(w.amountMsat)
|
||||
milliSatsFP := rfqmath.MilliSatoshiToUnits(amountMsat, *rate)
|
||||
numUnits := milliSatsFP.ScaleTo(0).ToUint64()
|
||||
|
||||
// If the calculated number of units is 0 then the asset rate
|
||||
// was not sufficient to represent the value of this payment.
|
||||
if numUnits == 0 {
|
||||
// We will calculate the minimum amount that can be
|
||||
// effectively sent with this asset by calculating the
|
||||
// value of a single asset unit, based on the provided
|
||||
// asset rate.
|
||||
|
||||
// We create the single unit.
|
||||
unit := rfqmath.FixedPointFromUint64[rfqmath.BigInt](
|
||||
1, 0,
|
||||
)
|
||||
|
||||
// We derive the minimum amount.
|
||||
minAmt := rfqmath.UnitsToMilliSatoshi(unit, *rate)
|
||||
|
||||
// We return the error to the user.
|
||||
return nil, fmt.Errorf("smallest payment with asset "+
|
||||
"rate %v is %v, cannot send %v",
|
||||
rate.ToUint64(), minAmt, amountMsat)
|
||||
}
|
||||
|
||||
msatPerUnit := uint64(w.amountMsat) / numUnits
|
||||
|
||||
fmt.Printf("Got quote for %v asset units at %v msat/unit from "+
|
||||
"peer %s with SCID %d\n", numUnits, msatPerUnit,
|
||||
quote.Peer, quote.Scid)
|
||||
|
||||
resp, err = w.stream.Recv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp == nil || resp.Result == nil ||
|
||||
resp.GetPaymentResult() == nil {
|
||||
|
||||
return nil, errors.New("unexpected nil result")
|
||||
}
|
||||
|
||||
return resp.GetPaymentResult(), nil
|
||||
|
||||
case *tchrpc.SendPaymentResponse_PaymentResult:
|
||||
return r.PaymentResult, nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected response type: %T", r)
|
||||
}
|
||||
}
|
||||
|
||||
var sendPaymentCommand = cli.Command{
|
||||
Name: "sendpayment",
|
||||
Category: commands.SendPaymentCommand.Category,
|
||||
Usage: "Send a payment over Lightning, potentially using a " +
|
||||
"mulit-asset channel as the first hop",
|
||||
Description: commands.SendPaymentCommand.Description + `
|
||||
To send an multi-asset LN payment to a single hop, the --asset_id=X
|
||||
argument should be used.
|
||||
|
||||
Note that this will only work in concert with the --keysend argument.
|
||||
`,
|
||||
ArgsUsage: commands.SendPaymentCommand.ArgsUsage + " --asset_id=X " +
|
||||
"--asset_amount=Y [--rfq_peer_pubkey=Z]",
|
||||
Flags: append(
|
||||
commands.SendPaymentCommand.Flags, assetIDFlag, assetAmountFlag,
|
||||
rfqPeerPubKeyFlag, allowOverpayFlag,
|
||||
),
|
||||
Action: sendPayment,
|
||||
}
|
||||
|
||||
func sendPayment(ctx *cli.Context) error {
|
||||
// Show command help if no arguments provided
|
||||
if ctx.NArg() == 0 && ctx.NumFlags() == 0 {
|
||||
_ = cli.ShowCommandHelp(ctx, "sendpayment")
|
||||
return nil
|
||||
}
|
||||
|
||||
lndConn, cleanup, err := connectClient(ctx, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to make rpc conn: %w", err)
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
tapdConn, cleanup, err := connectSuperMacClient(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating tapd connection: %w", err)
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
switch {
|
||||
case !ctx.IsSet(assetIDFlag.Name):
|
||||
return fmt.Errorf("the --asset_id flag must be set")
|
||||
case !ctx.IsSet("keysend"):
|
||||
return fmt.Errorf("the --keysend flag must be set")
|
||||
case !ctx.IsSet(assetAmountFlag.Name):
|
||||
return fmt.Errorf("--asset_amount must be set")
|
||||
}
|
||||
|
||||
assetIDStr := ctx.String(assetIDFlag.Name)
|
||||
assetIDBytes, err := hex.DecodeString(assetIDStr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode assetID: %v", err)
|
||||
}
|
||||
|
||||
assetAmountToSend := ctx.Uint64(assetAmountFlag.Name)
|
||||
if assetAmountToSend == 0 {
|
||||
return fmt.Errorf("must specify asset amount to send")
|
||||
}
|
||||
|
||||
// With the asset specific work out of the way, we'll parse the rest of
|
||||
// the command as normal.
|
||||
var (
|
||||
destNode []byte
|
||||
rHash []byte
|
||||
)
|
||||
|
||||
switch {
|
||||
case ctx.IsSet("dest"):
|
||||
destNode, err = hex.DecodeString(ctx.String("dest"))
|
||||
default:
|
||||
return fmt.Errorf("destination txid argument missing")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(destNode) != 33 {
|
||||
return fmt.Errorf("dest node pubkey must be exactly 33 bytes, "+
|
||||
"is instead: %v", len(destNode))
|
||||
}
|
||||
|
||||
rfqPeerKey, err := hex.DecodeString(ctx.String(rfqPeerPubKeyFlag.Name))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode RFQ peer public key: "+
|
||||
"%w", err)
|
||||
}
|
||||
|
||||
// Use the smallest possible non-dust HTLC amount to carry the asset
|
||||
// HTLCs. In the future, we can use the double HTLC trick here, though
|
||||
// it consumes more commitment space.
|
||||
req := &routerrpc.SendPaymentRequest{
|
||||
Dest: destNode,
|
||||
Amt: int64(rfqmath.DefaultOnChainHtlcSat),
|
||||
DestCustomRecords: make(map[uint64][]byte),
|
||||
}
|
||||
|
||||
if ctx.IsSet("payment_hash") {
|
||||
return errors.New("cannot set payment hash when using " +
|
||||
"keysend")
|
||||
}
|
||||
|
||||
// Read out the custom preimage for the keysend payment.
|
||||
var preimage lntypes.Preimage
|
||||
if _, err := rand.Read(preimage[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set the preimage. If the user supplied a preimage with the data
|
||||
// flag, the preimage that is set here will be overwritten later.
|
||||
req.DestCustomRecords[record.KeySendType] = preimage[:]
|
||||
|
||||
hash := preimage.Hash()
|
||||
rHash = hash[:]
|
||||
|
||||
req.PaymentHash = rHash
|
||||
allowOverpay := ctx.Bool(allowOverpayFlag.Name)
|
||||
|
||||
return commands.SendPaymentRequest(
|
||||
ctx, req, lndConn, tapdConn, func(ctx context.Context,
|
||||
payConn grpc.ClientConnInterface,
|
||||
req *routerrpc.SendPaymentRequest) (
|
||||
commands.PaymentResultStream, error) {
|
||||
|
||||
tchrpcClient := tchrpc.NewTaprootAssetChannelsClient(
|
||||
payConn,
|
||||
)
|
||||
|
||||
stream, err := tchrpcClient.SendPayment(
|
||||
ctx, &tchrpc.SendPaymentRequest{
|
||||
AssetId: assetIDBytes,
|
||||
AssetAmount: assetAmountToSend,
|
||||
PeerPubkey: rfqPeerKey,
|
||||
PaymentRequest: req,
|
||||
AllowOverpay: allowOverpay,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &resultStreamWrapper{
|
||||
stream: stream,
|
||||
}, nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
var payInvoiceCommand = cli.Command{
|
||||
Name: "payinvoice",
|
||||
Category: "Payments",
|
||||
Usage: "Pay an invoice over lightning using an asset.",
|
||||
Description: `
|
||||
This command attempts to pay an invoice using an asset channel as the
|
||||
source of the payment. The asset ID of the channel must be specified
|
||||
using the --asset_id flag.
|
||||
`,
|
||||
ArgsUsage: "pay_req --asset_id=X",
|
||||
Flags: append(commands.PaymentFlags(),
|
||||
cli.Int64Flag{
|
||||
Name: "amt",
|
||||
Usage: "(optional) number of satoshis to fulfill the " +
|
||||
"invoice",
|
||||
},
|
||||
assetIDFlag,
|
||||
rfqPeerPubKeyFlag,
|
||||
allowOverpayFlag,
|
||||
),
|
||||
Action: payInvoice,
|
||||
}
|
||||
|
||||
func payInvoice(ctx *cli.Context) error {
|
||||
args := ctx.Args()
|
||||
ctxb := context.Background()
|
||||
|
||||
var payReq string
|
||||
switch {
|
||||
case ctx.IsSet("pay_req"):
|
||||
payReq = ctx.String("pay_req")
|
||||
case args.Present():
|
||||
payReq = args.First()
|
||||
default:
|
||||
return fmt.Errorf("pay_req argument missing")
|
||||
}
|
||||
|
||||
superMacConn, cleanup, err := connectSuperMacClient(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to make rpc con: %w", err)
|
||||
}
|
||||
|
||||
defer cleanup()
|
||||
|
||||
lndClient := lnrpc.NewLightningClient(superMacConn)
|
||||
|
||||
decodeReq := &lnrpc.PayReqString{PayReq: payReq}
|
||||
decodeResp, err := lndClient.DecodePayReq(ctxb, decodeReq)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !ctx.IsSet(assetIDFlag.Name) {
|
||||
return fmt.Errorf("the --asset_id flag must be set")
|
||||
}
|
||||
|
||||
assetIDStr := ctx.String(assetIDFlag.Name)
|
||||
|
||||
assetIDBytes, err := hex.DecodeString(assetIDStr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode assetID: %v", err)
|
||||
}
|
||||
|
||||
rfqPeerKey, err := hex.DecodeString(ctx.String(rfqPeerPubKeyFlag.Name))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode RFQ peer public key: "+
|
||||
"%w", err)
|
||||
}
|
||||
|
||||
allowOverpay := ctx.Bool(allowOverpayFlag.Name)
|
||||
req := &routerrpc.SendPaymentRequest{
|
||||
PaymentRequest: commands.StripPrefix(payReq),
|
||||
}
|
||||
|
||||
return commands.SendPaymentRequest(
|
||||
ctx, req, superMacConn, superMacConn, func(ctx context.Context,
|
||||
payConn grpc.ClientConnInterface,
|
||||
req *routerrpc.SendPaymentRequest) (
|
||||
commands.PaymentResultStream, error) {
|
||||
|
||||
tchrpcClient := tchrpc.NewTaprootAssetChannelsClient(
|
||||
payConn,
|
||||
)
|
||||
|
||||
stream, err := tchrpcClient.SendPayment(
|
||||
ctx, &tchrpc.SendPaymentRequest{
|
||||
AssetId: assetIDBytes,
|
||||
PeerPubkey: rfqPeerKey,
|
||||
PaymentRequest: req,
|
||||
AllowOverpay: allowOverpay,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &resultStreamWrapper{
|
||||
amountMsat: decodeResp.NumMsat,
|
||||
stream: stream,
|
||||
}, nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
var addInvoiceCommand = cli.Command{
|
||||
Name: "addinvoice",
|
||||
Category: commands.AddInvoiceCommand.Category,
|
||||
Usage: "Add a new invoice to receive Taproot Assets.",
|
||||
Description: `
|
||||
Add a new invoice, expressing intent for a future payment, received in
|
||||
Taproot Assets.
|
||||
`,
|
||||
ArgsUsage: "asset_id asset_amount",
|
||||
Flags: append(
|
||||
commands.AddInvoiceCommand.Flags,
|
||||
cli.StringFlag{
|
||||
Name: "asset_id",
|
||||
Usage: "the asset ID of the asset to receive",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "asset_amount",
|
||||
Usage: "the amount of assets to receive",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "rfq_peer_pubkey",
|
||||
Usage: "(optional) the public key of the peer to ask " +
|
||||
"for a quote when converting from assets to " +
|
||||
"sats for the invoice; must be set if there " +
|
||||
"are multiple channels with the same " +
|
||||
"asset ID present",
|
||||
},
|
||||
),
|
||||
Action: addInvoice,
|
||||
}
|
||||
|
||||
func addInvoice(ctx *cli.Context) error {
|
||||
args := ctx.Args()
|
||||
ctxb := context.Background()
|
||||
|
||||
var assetIDStr string
|
||||
switch {
|
||||
case ctx.IsSet("asset_id"):
|
||||
assetIDStr = ctx.String("asset_id")
|
||||
case args.Present():
|
||||
assetIDStr = args.First()
|
||||
args = args.Tail()
|
||||
default:
|
||||
return fmt.Errorf("asset_id argument missing")
|
||||
}
|
||||
|
||||
var (
|
||||
assetAmount uint64
|
||||
preimage []byte
|
||||
descHash []byte
|
||||
err error
|
||||
)
|
||||
switch {
|
||||
case ctx.IsSet("asset_amount"):
|
||||
assetAmount = ctx.Uint64("asset_amount")
|
||||
case args.Present():
|
||||
assetAmount, err = strconv.ParseUint(args.First(), 10, 64)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse asset amount %w",
|
||||
err)
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("asset_amount argument missing")
|
||||
}
|
||||
|
||||
if ctx.IsSet("preimage") {
|
||||
preimage, err = hex.DecodeString(ctx.String("preimage"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse preimage: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
descHash, err = hex.DecodeString(ctx.String("description_hash"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse description_hash: %w", err)
|
||||
}
|
||||
|
||||
expirySeconds := int64(rfq.DefaultInvoiceExpiry.Seconds())
|
||||
if ctx.IsSet("expiry") {
|
||||
expirySeconds = ctx.Int64("expiry")
|
||||
}
|
||||
|
||||
assetIDBytes, err := hex.DecodeString(assetIDStr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode assetID: %v", err)
|
||||
}
|
||||
|
||||
var assetID asset.ID
|
||||
copy(assetID[:], assetIDBytes)
|
||||
|
||||
rfqPeerKey, err := hex.DecodeString(ctx.String(rfqPeerPubKeyFlag.Name))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode RFQ peer public key: "+
|
||||
"%w", err)
|
||||
}
|
||||
|
||||
tapdConn, cleanup, err := connectSuperMacClient(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating tapd connection: %w", err)
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
channelsClient := tchrpc.NewTaprootAssetChannelsClient(tapdConn)
|
||||
resp, err := channelsClient.AddInvoice(ctxb, &tchrpc.AddInvoiceRequest{
|
||||
AssetId: assetIDBytes,
|
||||
AssetAmount: assetAmount,
|
||||
PeerPubkey: rfqPeerKey,
|
||||
InvoiceRequest: &lnrpc.Invoice{
|
||||
Memo: ctx.String("memo"),
|
||||
RPreimage: preimage,
|
||||
DescriptionHash: descHash,
|
||||
FallbackAddr: ctx.String("fallback_addr"),
|
||||
Expiry: expirySeconds,
|
||||
Private: ctx.Bool("private"),
|
||||
IsAmp: ctx.Bool("amp"),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error adding invoice: %w", err)
|
||||
}
|
||||
|
||||
printRespJSON(resp)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var decodeAssetInvoiceCommand = cli.Command{
|
||||
Name: "decodeassetinvoice",
|
||||
Category: "Payments",
|
||||
Usage: "Decodes an LN invoice and displays the invoice's amount in " +
|
||||
"asset units specified by an asset ID",
|
||||
Description: `
|
||||
This command can be used to display the information encoded in an
|
||||
invoice.
|
||||
Given a chosen asset_id, the invoice's amount expressed in units of the
|
||||
asset will be displayed.
|
||||
|
||||
Other information such as the decimal display of an asset, and the asset
|
||||
group information (if applicable) are also shown.
|
||||
`,
|
||||
ArgsUsage: "--pay_req=X --asset_id=X",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "pay_req",
|
||||
Usage: "a zpay32 encoded payment request to fulfill",
|
||||
},
|
||||
assetIDFlag,
|
||||
},
|
||||
Action: decodeAssetInvoice,
|
||||
}
|
||||
|
||||
func decodeAssetInvoice(ctx *cli.Context) error {
|
||||
ctxb := context.Background()
|
||||
|
||||
switch {
|
||||
case !ctx.IsSet("pay_req"):
|
||||
return fmt.Errorf("pay_req argument missing")
|
||||
case !ctx.IsSet(assetIDFlag.Name):
|
||||
return fmt.Errorf("the --asset_id flag must be set")
|
||||
}
|
||||
|
||||
payReq := ctx.String("pay_req")
|
||||
|
||||
assetIDStr := ctx.String(assetIDFlag.Name)
|
||||
assetIDBytes, err := hex.DecodeString(assetIDStr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode assetID: %v", err)
|
||||
}
|
||||
|
||||
tapdConn, cleanup, err := connectSuperMacClient(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to make rpc con: %w", err)
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
channelsClient := tchrpc.NewTaprootAssetChannelsClient(tapdConn)
|
||||
resp, err := channelsClient.DecodeAssetPayReq(ctxb, &tchrpc.AssetPayReq{
|
||||
AssetId: assetIDBytes,
|
||||
PayReqString: payReq,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error adding invoice: %w", err)
|
||||
}
|
||||
|
||||
printRespJSON(resp)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,14 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
terminal "github.com/lightninglabs/lightning-terminal"
|
||||
"github.com/lightninglabs/lightning-terminal/litrpc"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
"github.com/lightningnetwork/lnd/cmd/commands"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
|
|
@ -69,6 +72,23 @@ func main() {
|
|||
baseDirFlag,
|
||||
tlsCertFlag,
|
||||
macaroonPathFlag,
|
||||
// The following two flags are only required for the 'litcli ln'
|
||||
// sub commands, because they call into lnd's commands package
|
||||
// that requires them. They only need to be _defined_, but
|
||||
// they're not actually actively used.
|
||||
cli.StringFlag{
|
||||
Name: "lnddir",
|
||||
Usage: "Path to lnd's base directory",
|
||||
Hidden: true,
|
||||
Value: commands.DefaultLndDir,
|
||||
},
|
||||
cli.Int64Flag{
|
||||
Name: "macaroontimeout",
|
||||
Value: 60,
|
||||
Hidden: true,
|
||||
Usage: "Anti-replay macaroon validity time in " +
|
||||
"seconds.",
|
||||
},
|
||||
}
|
||||
app.Commands = append(app.Commands, sessionCommands...)
|
||||
app.Commands = append(app.Commands, accountsCommands...)
|
||||
|
|
@ -78,6 +98,7 @@ func main() {
|
|||
app.Commands = append(app.Commands, litCommands...)
|
||||
app.Commands = append(app.Commands, helperCommands)
|
||||
app.Commands = append(app.Commands, statusCommands...)
|
||||
app.Commands = append(app.Commands, lnCommands...)
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
|
|
@ -98,7 +119,7 @@ func connectClient(ctx *cli.Context, noMac bool) (grpc.ClientConnInterface,
|
|||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
conn, err := getClientConn(rpcServer, tlsCertPath, macPath, noMac)
|
||||
conn, err := getClientConn(rpcServer, tlsCertPath, macPath, noMac, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
@ -107,14 +128,42 @@ func connectClient(ctx *cli.Context, noMac bool) (grpc.ClientConnInterface,
|
|||
return conn, cleanup, nil
|
||||
}
|
||||
|
||||
func getClientConn(address, tlsCertPath, macaroonPath string, noMac bool) (
|
||||
*grpc.ClientConn, error) {
|
||||
func connectClientWithMac(ctx *cli.Context,
|
||||
mac []byte) (grpc.ClientConnInterface, func(), error) {
|
||||
|
||||
rpcServer := ctx.GlobalString("rpcserver")
|
||||
tlsCertPath, macPath, err := extractPathArgs(ctx)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
conn, err := getClientConn(rpcServer, tlsCertPath, macPath, false, mac)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
cleanup := func() { _ = conn.Close() }
|
||||
|
||||
return conn, cleanup, nil
|
||||
}
|
||||
|
||||
func getClientConn(address, tlsCertPath, macaroonPath string, noMac bool,
|
||||
customMac []byte) (*grpc.ClientConn, error) {
|
||||
|
||||
opts := []grpc.DialOption{
|
||||
grpc.WithDefaultCallOptions(maxMsgRecvSize),
|
||||
}
|
||||
|
||||
if !noMac {
|
||||
switch {
|
||||
case len(customMac) > 0:
|
||||
macOption, err := macFromBytes(customMac)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opts = append(opts, macOption)
|
||||
|
||||
case noMac:
|
||||
// Don't do anything.
|
||||
|
||||
default:
|
||||
macOption, err := readMacaroon(macaroonPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -196,13 +245,18 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) {
|
|||
// gRPC dial options from it.
|
||||
func readMacaroon(macPath string) (grpc.DialOption, error) {
|
||||
// Load the specified macaroon file.
|
||||
macBytes, err := ioutil.ReadFile(macPath)
|
||||
macBytes, err := os.ReadFile(macPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to read macaroon path : %v", err)
|
||||
}
|
||||
|
||||
return macFromBytes(macBytes)
|
||||
}
|
||||
|
||||
// macFromBytes returns a macaroon from the given byte slice.
|
||||
func macFromBytes(macBytes []byte) (grpc.DialOption, error) {
|
||||
mac := &macaroon.Macaroon{}
|
||||
if err = mac.UnmarshalBinary(macBytes); err != nil {
|
||||
if err := mac.UnmarshalBinary(macBytes); err != nil {
|
||||
return nil, fmt.Errorf("unable to decode macaroon: %v", err)
|
||||
}
|
||||
|
||||
|
|
@ -244,3 +298,29 @@ func printRespJSON(resp proto.Message) { // nolint
|
|||
|
||||
fmt.Println(string(jsonBytes))
|
||||
}
|
||||
|
||||
func connectSuperMacClient(ctx *cli.Context) (grpc.ClientConnInterface,
|
||||
func(), error) {
|
||||
|
||||
litdConn, cleanup, err := connectClient(ctx, false)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("error connecting client: %w", err)
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
ctxb := context.Background()
|
||||
litClient := litrpc.NewProxyClient(litdConn)
|
||||
macResp, err := litClient.BakeSuperMacaroon(
|
||||
ctxb, &litrpc.BakeSuperMacaroonRequest{},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("error baking macaroon: %w", err)
|
||||
}
|
||||
|
||||
macBytes, err := hex.DecodeString(macResp.Macaroon)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("error decoding macaroon: %w", err)
|
||||
}
|
||||
|
||||
return connectClientWithMac(ctx, macBytes)
|
||||
}
|
||||
|
|
|
|||
22
config.go
22
config.go
|
|
@ -31,6 +31,7 @@ import (
|
|||
"github.com/lightningnetwork/lnd/cert"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
"github.com/mwitkow/go-conntrack/connhelpers"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
|
|
@ -189,9 +190,10 @@ type Config struct {
|
|||
// friendly. Because then we can reference the explicit modes in the
|
||||
// help descriptions of the section headers. We'll parse the mode into
|
||||
// a bool for internal use for better code readability.
|
||||
LndMode string `long:"lnd-mode" description:"The mode to run lnd in, either 'remote' (default) or 'integrated'. 'integrated' means lnd is started alongside the UI and everything is stored in lnd's main data directory, configure everything by using the --lnd.* flags. 'remote' means the UI connects to an existing lnd node and acts as a proxy for gRPC calls to it. In the remote node LiT creates its own directory for log and configuration files, configure everything using the --remote.* flags." choice:"integrated" choice:"remote"`
|
||||
Lnd *lnd.Config `group:"Integrated lnd (use when lnd-mode=integrated)" namespace:"lnd"`
|
||||
LndRPCTimeout time.Duration `long:"lndrpctimeout" description:"The timeout for RPC calls to lnd from other sub servers. This can be adjusted for slow lnd instances to give loop/pool/faraday/taproot-assets more time when querying into lnd's RPC methods. This value should NOT be set to anything below 30 seconds to avoid problems."`
|
||||
LndMode string `long:"lnd-mode" description:"The mode to run lnd in, either 'remote' (default) or 'integrated'. 'integrated' means lnd is started alongside the UI and everything is stored in lnd's main data directory, configure everything by using the --lnd.* flags. 'remote' means the UI connects to an existing lnd node and acts as a proxy for gRPC calls to it. In the remote node LiT creates its own directory for log and configuration files, configure everything using the --remote.* flags." choice:"integrated" choice:"remote"`
|
||||
Lnd *lnd.Config `group:"Integrated lnd (use when lnd-mode=integrated)" namespace:"lnd"`
|
||||
LndRPCTimeout time.Duration `long:"lndrpctimeout" description:"The timeout for RPC calls to lnd from other sub servers. This can be adjusted for slow lnd instances to give loop/pool/faraday/taproot-assets more time when querying into lnd's RPC methods. This value should NOT be set to anything below 30 seconds to avoid problems."`
|
||||
LndConnectInterval time.Duration `long:"lndconnectinterval" hidden:"true" description:"The interval at which LiT tries to connect to the lnd node. This value should only be changed for development mode."`
|
||||
|
||||
FaradayMode string `long:"faraday-mode" description:"The mode to run faraday in, either 'integrated' (default), 'remote' or 'disable'. 'integrated' means faraday is started alongside the UI and everything is stored in faraday's main data directory, configure everything by using the --faraday.* flags. 'remote' means the UI connects to an existing faraday node and acts as a proxy for gRPC calls to it. 'disable' means that LiT is started without faraday." choice:"integrated" choice:"remote" choice:"disable"`
|
||||
Faraday *faraday.Config `group:"Integrated faraday options (use when faraday-mode=integrated)" namespace:"faraday"`
|
||||
|
|
@ -313,6 +315,7 @@ func defaultConfig() *Config {
|
|||
LndMode: DefaultLndMode,
|
||||
Lnd: &lndDefaultConfig,
|
||||
LndRPCTimeout: defaultRPCTimeout,
|
||||
LndConnectInterval: defaultStartupTimeout,
|
||||
LitDir: DefaultLitDir,
|
||||
LetsEncryptListen: defaultLetsEncryptListen,
|
||||
LetsEncryptDir: defaultLetsEncryptDir,
|
||||
|
|
@ -627,6 +630,19 @@ func loadConfigFile(preCfg *Config, interceptor signal.Interceptor) (*Config,
|
|||
// configuration is fully valid. This also sets up the main logger that
|
||||
// logs to a sub-directory in the .lnd folder.
|
||||
case ModeIntegrated:
|
||||
// For the integration of tapd with lnd, we need to allow tapd
|
||||
// to send custom error messages to peers through the
|
||||
// SendCustomMessage RPC in lnd. Since the error messages aren't
|
||||
// in the custom range, we explicitly need to allow them. This
|
||||
// isn't currently needed in remote mode, because custom
|
||||
// channels are only available if both lnd and tapd are running
|
||||
// in integrated mode. We need to set this value before we call
|
||||
// lnd.ValidateConfig() below, because that's what's going to
|
||||
// inject these values into the lnwire package.
|
||||
cfg.Lnd.ProtocolOptions.CustomMessage = append(
|
||||
cfg.Lnd.ProtocolOptions.CustomMessage, lnwire.MsgError,
|
||||
)
|
||||
|
||||
var err error
|
||||
cfg.Lnd, err = lnd.ValidateConfig(
|
||||
*cfg.Lnd, interceptor, fileParser, flagParser,
|
||||
|
|
|
|||
|
|
@ -23,10 +23,19 @@ COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /g
|
|||
# queries required to connect to linked containers succeed.
|
||||
ENV GODEBUG netdns=cgo
|
||||
|
||||
# Allow forcing a specific taproot-assets version through a build argument.
|
||||
# Please see https://go.dev/ref/mod#version-queries for the types of
|
||||
# queries that can be used to define a version.
|
||||
ARG TAPROOT_ASSETS_VERSION
|
||||
|
||||
# Install dependencies and install/build lightning-terminal.
|
||||
RUN apk add --no-cache --update alpine-sdk \
|
||||
make \
|
||||
RUN apk add --no-cache --update alpine-sdk make \
|
||||
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
|
||||
# If a custom taproot-assets version is supplied, force it now.
|
||||
&& if [ -n "$TAPROOT_ASSETS_VERSION" ]; then \
|
||||
go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
|
||||
&& go mod tidy; \
|
||||
fi \
|
||||
&& make go-install \
|
||||
&& make go-install-cli
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
especially useful in stateless-init mode where users will not have access to
|
||||
a LiT macaroon to perform this call with.
|
||||
|
||||
* [Convert litrpc package into a module](https://github.com/lightninglabs/lightning-terminal/pull/823).
|
||||
|
||||
### Technical and Architectural Updates
|
||||
|
||||
* [Convert litrpc package into a module](https://github.com/lightninglabs/lightning-terminal/pull/823).
|
||||
|
|
|
|||
|
|
@ -34,6 +34,16 @@
|
|||
network](https://github.com/lightninglabs/lightning-terminal/pull/902). This
|
||||
can be done using the `--network=signet` config option.
|
||||
|
||||
* Add [custom channel
|
||||
functionality](https://github.com/lightninglabs/lightning-terminal/pull/848)
|
||||
to `litd`. Custom channels with Taproot Assets can now be created when `litd`
|
||||
runs in integrated `lnd` mode (`lnd-mode=integrated`) with the Taproot Assets
|
||||
daemon also running in integrated mode (`taproot-assets-mode=integrated`).
|
||||
|
||||
* [Add itest](https://github.com/lightninglabs/lightning-terminal/pull/892) for
|
||||
the MinRelayFee check added in Taproot Assets. The test ensures that
|
||||
transactions with fees below the minimum relay fee are rejected.
|
||||
|
||||
### Technical and Architectural Updates
|
||||
|
||||
## Integrated Binary Updates
|
||||
|
|
@ -42,13 +52,24 @@
|
|||
|
||||
### Loop
|
||||
|
||||
* Updated Loop [to the latest version
|
||||
`v0.29.0-beta`](https://github.com/lightninglabs/loop/releases/tag/v0.29.0-beta).
|
||||
|
||||
### Pool
|
||||
|
||||
### Faraday
|
||||
|
||||
### Taproot Assets
|
||||
|
||||
* Updated `tapd` [to the latest version
|
||||
`v0.5.0-alpha`](https://github.com/lightninglabs/taproot-assets/releases/tag/v0.5.0).
|
||||
|
||||
# Contributors (Alphabetical Order)
|
||||
|
||||
* Elle Mouton
|
||||
* Oliver Gugger
|
||||
* George Tsagkarelis
|
||||
* Gijs van Dam
|
||||
* Jamal James
|
||||
* Jonathan Harvey-Buschel
|
||||
* Olaoluwa Osuntokun
|
||||
* Oliver Gugger
|
||||
62
go.mod
62
go.mod
|
|
@ -1,12 +1,13 @@
|
|||
module github.com/lightninglabs/lightning-terminal
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.24.2
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.3
|
||||
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.4
|
||||
github.com/btcsuite/btcd/btcutil v1.1.5
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.2
|
||||
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.4
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/go-errors/errors v1.0.1
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
|
||||
github.com/improbable-eng/grpc-web v0.12.0
|
||||
|
|
@ -15,15 +16,17 @@ require (
|
|||
github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee4e7ff52f83
|
||||
github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.1
|
||||
github.com/lightninglabs/lightning-terminal/litrpc v1.0.0
|
||||
github.com/lightninglabs/lndclient v0.18.0-3
|
||||
github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c
|
||||
github.com/lightninglabs/loop/looprpc v1.0.0
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.10
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20240531084722-4000ec802aaa
|
||||
github.com/lightninglabs/lndclient v0.18.4-9
|
||||
github.com/lightninglabs/loop v0.29.0-beta
|
||||
github.com/lightninglabs/loop/looprpc v1.0.2
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.11
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20241015105339-044cb451b5df
|
||||
github.com/lightninglabs/pool/auctioneerrpc v1.1.2
|
||||
github.com/lightninglabs/taproot-assets v0.4.2-0.20240725155459-2bf18437e945
|
||||
github.com/lightningnetwork/lnd v0.18.3-beta
|
||||
github.com/lightninglabs/pool/poolrpc v1.0.0
|
||||
github.com/lightninglabs/taproot-assets v0.5.0
|
||||
github.com/lightningnetwork/lnd v0.18.4-beta
|
||||
github.com/lightningnetwork/lnd/cert v1.2.2
|
||||
github.com/lightningnetwork/lnd/fn v1.2.3
|
||||
github.com/lightningnetwork/lnd/kvdb v1.4.10
|
||||
github.com/lightningnetwork/lnd/tlv v1.2.6
|
||||
github.com/lightningnetwork/lnd/tor v1.1.2
|
||||
|
|
@ -31,8 +34,9 @@ require (
|
|||
github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/urfave/cli v1.22.9
|
||||
go.etcd.io/bbolt v1.3.8
|
||||
go.etcd.io/bbolt v1.3.11
|
||||
golang.org/x/crypto v0.31.0
|
||||
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
|
||||
golang.org/x/net v0.27.0
|
||||
golang.org/x/sync v0.10.0
|
||||
google.golang.org/grpc v1.65.0
|
||||
|
|
@ -42,7 +46,7 @@ require (
|
|||
)
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e // indirect
|
||||
|
|
@ -54,11 +58,11 @@ require (
|
|||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/btcsuite/btcd/btcutil/psbt v1.1.8 // indirect
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240718224643-db3a4a2543bd // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.1 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4 // indirect
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.3 // indirect
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 // indirect
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.4 // indirect
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
|
||||
github.com/btcsuite/winsvc v1.0.0 // indirect
|
||||
|
|
@ -71,7 +75,6 @@ require (
|
|||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
|
||||
github.com/decred/dcrd/lru v1.1.2 // indirect
|
||||
|
|
@ -86,7 +89,7 @@ require (
|
|||
github.com/fortytw2/leaktest v1.3.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
|
||||
github.com/golang-migrate/migrate/v4 v4.17.0 // indirect
|
||||
|
|
@ -120,22 +123,21 @@ require (
|
|||
github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.2.7 // indirect
|
||||
github.com/jonboulle/clockwork v0.2.2 // indirect
|
||||
github.com/jrick/logrotate v1.0.0 // indirect
|
||||
github.com/jrick/logrotate v1.1.2 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/juju/loggo v1.0.0 // indirect
|
||||
github.com/kkdai/bstream v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.15.11 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/libdns/libdns v0.2.1 // indirect
|
||||
github.com/lightninglabs/aperture v0.3.2-beta // indirect
|
||||
github.com/lightninglabs/aperture v0.3.4-beta // indirect
|
||||
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
|
||||
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 // indirect
|
||||
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect
|
||||
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
|
||||
github.com/lightningnetwork/lnd/clock v1.1.1 // indirect
|
||||
github.com/lightningnetwork/lnd/fn v1.2.0 // indirect
|
||||
github.com/lightningnetwork/lnd/healthcheck v1.2.5 // indirect
|
||||
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
|
||||
github.com/lightningnetwork/lnd/sqldb v1.0.4 // indirect
|
||||
|
|
@ -158,7 +160,7 @@ require (
|
|||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.37.0 // indirect
|
||||
github.com/prometheus/procfs v0.8.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
|
|
@ -189,18 +191,17 @@ require (
|
|||
go.etcd.io/etcd/raft/v3 v3.5.12 // indirect
|
||||
go.etcd.io/etcd/server/v3 v3.5.12 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
go.uber.org/mock v0.4.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.23.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
golang.org/x/term v0.27.0 // indirect
|
||||
|
|
@ -222,6 +223,7 @@ require (
|
|||
modernc.org/strutil v1.2.0 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
pgregory.net/rapid v1.1.0 // indirect
|
||||
sigs.k8s.io/yaml v1.2.0 // indirect
|
||||
)
|
||||
|
||||
|
|
@ -234,4 +236,4 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d
|
|||
|
||||
replace github.com/lightninglabs/lightning-terminal/litrpc => ./litrpc
|
||||
|
||||
go 1.22.3
|
||||
go 1.22.6
|
||||
|
|
|
|||
113
go.sum
113
go.sum
|
|
@ -596,8 +596,8 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS
|
|||
cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M=
|
||||
cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA=
|
||||
cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw=
|
||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
|
||||
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
|
||||
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
|
||||
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
|
||||
|
|
@ -651,12 +651,12 @@ github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
|
|||
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
|
||||
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
|
||||
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
|
||||
github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY=
|
||||
github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg=
|
||||
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53 h1:XOZ/wRGHkKv0AqxfDks5IkzaQ1Ge6fq322ZOOG5VIkU=
|
||||
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53/go.mod h1:zHK7t7sw8XbsCkD64WePHE3r3k9/XoGAcf6mXV14c64=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.3 h1:6+iXlDKE8RMtKsvK0gshlXIuPbyWM/h84Ensb7o3sC0=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.3/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
|
||||
|
|
@ -667,21 +667,22 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtyd
|
|||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
|
||||
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c h1:4HxD1lBUGUddhzgaNgrCPsFWd7cGYNpeFUgd9ZIgyM0=
|
||||
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c/go.mod h1:w7xnGOhwT3lmrS4H3b/D1XAXxvh+tbhUm8xeHN2y3TQ=
|
||||
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240718224643-db3a4a2543bd h1:QDb8foTCRoXrfoZVEzSYgSde16MJh4gCtCin8OCS0kI=
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240718224643-db3a4a2543bd/go.mod h1:X2xDre+j1QphTRo54y2TikUzeSvreL1t1aMXrD8Kc5A=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 h1:poyHFf7+5+RdxNp5r2T6IBRD7RyraUsYARYbp/7t4D8=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4/go.mod h1:GETGDQuyq+VFfH1S/+/7slLM/9aNa4l7P4ejX6dJfb0=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.1 h1:UZo7YRzdHbwhK7Rhv3PO9bXgTxiOH45edK5qdsdiatk=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.1/go.mod h1:MVSqRkju/IGxImXYPfBkG65FgEZYA4fXchheILMVl8g=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4 h1:nmcKAVTv/cmYrs0A4hbiC6Qw+WTLYy/14SmTt3mLnCo=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4/go.mod h1:YqJR8WAAHiKIPesZTr9Cx9Az4fRhRLcJ6GcxzRUZCAc=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.2 h1:zwZZ+zaHo4mK+FAN6KeK85S3oOm+92x2avsHvFAhVBE=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.2/go.mod h1:7ZQ+BvOEre90YT7eSq8bLoxTsgXidUzA/mqbRS114CQ=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.3 h1:QrWCio9Leh3DwkWfp+A1SURj8pYn3JuTLv3waP5uEro=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.3/go.mod h1:M4nQpxGTXiDlSOODKXboXX7NFthmiBNjzAKKNS7Fhjg=
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5 h1:zYy233eUBvkF3lq2MUkybEhxhDsrRDSgiToIKN57mtk=
|
||||
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5/go.mod h1:1HJXYbjJzgumlnxOC2+ViR1U+gnHWoOn7WeK5OfY1eU=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 h1:Rr0njWI3r341nhSPesKQ2JF+ugDSzdPoeckS75SeDZk=
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5/go.mod h1:+tXJ3Ym0nlQc/iHSwW1qzjmPs3ev+UVWMbGgfV1OZqU=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 h1:YEO+Lx1ZJJAtdRrjuhXjWrYsmAk26wLTlNzxt2q0lhk=
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2/go.mod h1:4v+grppsDpVn91SJv+mZT7B8hEV4nSmpREM4I8Uohws=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 h1:93o5Xz9dYepBP4RMFUc9RGIFXwqP2volSWRkYJFrNtI=
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5/go.mod h1:lQ+e9HxZ85QP7r3kdxItkiMSloSLg1PEGis5o5CXUQw=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.4 h1:BDel6iT/ltYSIYKs0YbjwnEDi7xR3yzABIsQxN2F1L8=
|
||||
github.com/btcsuite/btcwallet/walletdb v1.4.4/go.mod h1:jk/hvpLFINF0C1kfTn0bfx2GbnFT+Nvnj6eblZALfjs=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.4 h1:hJjHy1h/dJwSfD9uDsCwcH21D1iOrus6OrI5gR9E/O0=
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.5.4/go.mod h1:lAv0b1Vj9Ig5U8QFm0yiJ9WqPl8yGO/6l7JxdHY1PKE=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
|
||||
github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8/go.mod h1:tYvUd8KLhm/oXvUeSEs2VlLghFjQt9+ZaF9ghH0JNjc=
|
||||
|
|
@ -854,8 +855,8 @@ github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO
|
|||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
||||
|
|
@ -1081,8 +1082,9 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS
|
|||
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
|
||||
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
|
||||
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
|
||||
github.com/jrick/logrotate v1.1.2 h1:6ePk462NCX7TfKtNp5JJ7MbA2YIslkpfgP03TlTYMN0=
|
||||
github.com/jrick/logrotate v1.1.2/go.mod h1:f9tdWggSVK3iqavGpyvegq5IhNois7KXmasU6/N96OQ=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
|
|
@ -1115,8 +1117,8 @@ github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+
|
|||
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
|
||||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c=
|
||||
github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
|
||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
|
||||
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
|
|
@ -1145,8 +1147,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
|||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/libdns/libdns v0.2.1 h1:Wu59T7wSHRgtA0cfxC+n1c/e+O3upJGWytknkmFEDis=
|
||||
github.com/libdns/libdns v0.2.1/go.mod h1:yQCXzk1lEZmmCPa857bnk4TsOiqYasqpyOEeSObbb40=
|
||||
github.com/lightninglabs/aperture v0.3.2-beta h1:J2GQwBmSHxpr5VOatXbgrTogF/qN2l6UWLPHfIowq10=
|
||||
github.com/lightninglabs/aperture v0.3.2-beta/go.mod h1:M/5dPzHjHvuYXQuxzicqaGiCclHUvKW6N0ay1t/HGiM=
|
||||
github.com/lightninglabs/aperture v0.3.4-beta h1:TiQHw1+2CdW785U88uH0BmwUmv0R7nyfvmF9neQd56o=
|
||||
github.com/lightninglabs/aperture v0.3.4-beta/go.mod h1:xuusZUPdKzQN8wKT5yL2eML8To9nz+AXoRoQa/njd4Q=
|
||||
github.com/lightninglabs/faraday v0.2.13-alpha h1:rpk3IM5WyyEd/wghGWpGcUyDazQhwdfkuj+D/AvDlgk=
|
||||
github.com/lightninglabs/faraday v0.2.13-alpha/go.mod h1:hzuTMntsY7X3gxeBLZ6kYduZlKtXUgqtk1WnnEF0aIg=
|
||||
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc=
|
||||
|
|
@ -1155,36 +1157,38 @@ github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee
|
|||
github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee4e7ff52f83/go.mod h1:+SasPOt0evcJdfApb/ALTaTz4x3a2/kWy5KqFoTpiX8=
|
||||
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.18.0-3 h1:2k5NZJgtrcJlW3KFhvtquS7CWwKwjFN9rtLNa8MlqRA=
|
||||
github.com/lightninglabs/lndclient v0.18.0-3/go.mod h1:D/0qn5s0JSdB3Kelkw4vl3bqnuZ0IHHORAv9sJjYJcQ=
|
||||
github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c h1:DQqiAv0xUErCOVtUeVDXKTafJFRcN7Ce32Mu51Ah8Ew=
|
||||
github.com/lightninglabs/loop v0.28.8-beta.0.20241025130130-d5df72f56c8c/go.mod h1:30wla2TOtMyJ17OhPu3XjXZOKwm9ZZr2cpjcCDvU3ko=
|
||||
github.com/lightninglabs/loop/looprpc v1.0.0 h1:xry4QPCZShPww660xJm1BVcNFj8etgNeN2vMpfsv3c4=
|
||||
github.com/lightninglabs/loop/looprpc v1.0.0/go.mod h1:+hPlWT2LGxEUY9mMVB2FcbV3KJmd1cmEezmZQagVUtY=
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.10 h1:ZLib2zUytlYOwCYOEyWUPJE16wyjR3UG0MmG/Kx/NUc=
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.10/go.mod h1:Ml3gMwe/iTRLvu1QGGZzXcr0DYSa9sJGwKPktLaWtwE=
|
||||
github.com/lightninglabs/lndclient v0.18.4-9 h1:8PRBmJLyegs1zbqBvpN/0d8qGLiNst3MEtTdO4Wt+SA=
|
||||
github.com/lightninglabs/lndclient v0.18.4-9/go.mod h1:11hKoRxXk+1IoIndEIvbmo18dwAJnTqr/lylRpYDVSU=
|
||||
github.com/lightninglabs/loop v0.29.0-beta h1:YRxZ3h41LsFOLTyvisxbijmvCf5UOUx4T0YUemdi0wA=
|
||||
github.com/lightninglabs/loop v0.29.0-beta/go.mod h1:Lc1qXyO0LoOHQVkzwxVlHTavybGGz0I1t5YozWH1WNo=
|
||||
github.com/lightninglabs/loop/looprpc v1.0.2 h1:evL3GpceeFaYmkeqf4hzeXQXgjrHeF3fzcB5Eajh7SM=
|
||||
github.com/lightninglabs/loop/looprpc v1.0.2/go.mod h1:w6zur9qV9EBY7I7bpnUYp0QGjVqNl9cjnozpPal9/XY=
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.11 h1:R/8c/bo4rpqm5/cfi944rj24oQUlZu+xXjzMhEDSkrc=
|
||||
github.com/lightninglabs/loop/swapserverrpc v1.0.11/go.mod h1:Ml3gMwe/iTRLvu1QGGZzXcr0DYSa9sJGwKPktLaWtwE=
|
||||
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd h1:D8aRocHpoCv43hL8egXEMYyPmyOiefFHZ66338KQB2s=
|
||||
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk=
|
||||
github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g=
|
||||
github.com/lightninglabs/neutrino/cache v1.1.2/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo=
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20240531084722-4000ec802aaa h1:UYqz8O8teeSU1383NLUMIADCD2QplOeJVjiB4k1xeSI=
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20240531084722-4000ec802aaa/go.mod h1:x2+mFwSvKlBqUES3z5TdoXolS2dWD1ksueRcMORyAJA=
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20241015105339-044cb451b5df h1:EdiN1GxUI+442K6xZcLg9mq/PekvRoSWUGuEKCjLDww=
|
||||
github.com/lightninglabs/pool v0.6.5-beta.0.20241015105339-044cb451b5df/go.mod h1:ONyfvFj3e3D0AkhpTTZPGDuIDAcY2ODnlj86aDfs2q4=
|
||||
github.com/lightninglabs/pool/auctioneerrpc v1.1.2 h1:Dbg+9Z9jXnhimR27EN37foc4aB1uQqndm/YOO+XAdMA=
|
||||
github.com/lightninglabs/pool/auctioneerrpc v1.1.2/go.mod h1:1wKDzN2zEP8srOi0B9iySlEsPdoPhw6oo3Vbm1v4Mhw=
|
||||
github.com/lightninglabs/pool/poolrpc v1.0.0 h1:vvosrgNx9WXF4mcHGqLjZOW8wNM0q+BLVfdn897AFLw=
|
||||
github.com/lightninglabs/pool/poolrpc v1.0.0/go.mod h1:ZqpEpBFRMMBAerMmilEjh27tqauSXDwLaLR0O3jvmMA=
|
||||
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.4.2-0.20240725155459-2bf18437e945 h1:vzr2NtI1M9/LQDv7malP0EmV9vVkh2ve5ZpDUcYFC6s=
|
||||
github.com/lightninglabs/taproot-assets v0.4.2-0.20240725155459-2bf18437e945/go.mod h1:+mGg1ZNFzzcb55ZLd1UulW4iiq+ruzRHOTjCKHBeQ2g=
|
||||
github.com/lightninglabs/taproot-assets v0.5.0 h1:aXX08DsV9ObUCm5jAbUsd0B1llcAqQHVAfrxtRu+q7Q=
|
||||
github.com/lightninglabs/taproot-assets v0.5.0/go.mod h1:7XEbJ8DZ79hkYUNuZceuynT6vGqDNdAn7l20knK9DfI=
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
|
||||
github.com/lightningnetwork/lnd v0.18.3-beta h1:I1Mcz79HGpVGPz0U2jSdxzzqzIi2cwUF0DXtzYJS7C8=
|
||||
github.com/lightningnetwork/lnd v0.18.3-beta/go.mod h1:Xamph8AYM3iWyyn9w/tx+cLG6Tx1SSnSSPRFn71zuyQ=
|
||||
github.com/lightningnetwork/lnd v0.18.4-beta h1:4pGmIjIMisrs4TMDYp4fk8NeI1YFpcuqwaSiFwLcd1g=
|
||||
github.com/lightningnetwork/lnd v0.18.4-beta/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
|
||||
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.0 h1:YTb2m8NN5ZiJAskHeBZAmR1AiPY8SXziIYPAX1VI/ZM=
|
||||
github.com/lightningnetwork/lnd/fn v1.2.0/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0=
|
||||
github.com/lightningnetwork/lnd/fn v1.2.3 h1:Q1OrgNSgQynVheBNa16CsKVov1JI5N2AR6G07x9Mles=
|
||||
github.com/lightningnetwork/lnd/fn v1.2.3/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0=
|
||||
github.com/lightningnetwork/lnd/healthcheck v1.2.5 h1:aTJy5xeBpcWgRtW/PGBDe+LMQEmNm/HQewlQx2jt7OA=
|
||||
github.com/lightningnetwork/lnd/healthcheck v1.2.5/go.mod h1:G7Tst2tVvWo7cx6mSBEToQC5L1XOGxzZTPB29g9Rv2I=
|
||||
github.com/lightningnetwork/lnd/kvdb v1.4.10 h1:vK89IVv1oVH9ubQWU+EmoCQFeVRaC8kfmOrqHbY5zoY=
|
||||
|
|
@ -1297,8 +1301,9 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:
|
|||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||
github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
|
||||
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
|
|
@ -1407,8 +1412,8 @@ github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaD
|
|||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiVfzQttTuxanPIT43FtkkCFypIod8LHo=
|
||||
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ=
|
||||
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
|
||||
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
|
||||
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
|
||||
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
|
||||
go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c=
|
||||
go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.12 h1:EYDL6pWwyOsylrQyLp2w+HkQ46ATiOvoEdMarindU2A=
|
||||
|
|
@ -1433,20 +1438,20 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
|||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
|
||||
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
|
||||
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0=
|
||||
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
|
||||
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
|
||||
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
|
||||
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
|
||||
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
|
||||
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
|
||||
|
|
@ -2264,6 +2269,8 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
|||
modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8=
|
||||
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
|
||||
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
|
||||
pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
|
|
|
|||
|
|
@ -3,14 +3,18 @@ package itest
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// shutdownAndAssert shuts down the given node and asserts that no errors
|
||||
|
|
@ -172,24 +176,25 @@ func assertChannelClosed(ctx context.Context, t *harnessTest,
|
|||
// block.
|
||||
block := mineBlocks(t, net, 1, 1)[0]
|
||||
|
||||
closingTxid, err := net.WaitForChannelClose(closeUpdates)
|
||||
closingUpdate, err := net.WaitForChannelClose(closeUpdates)
|
||||
require.NoError(t.t, err, "error while waiting for channel close")
|
||||
|
||||
closingTxid, err := chainhash.NewHash(closingUpdate.ClosingTxid)
|
||||
require.NoError(t.t, err)
|
||||
assertTxInBlock(t, block, closingTxid)
|
||||
|
||||
// Finally, the transaction should no longer be in the waiting close
|
||||
// state as we've just mined a block that should include the closing
|
||||
// transaction.
|
||||
err = wait.Predicate(func() bool {
|
||||
pendingChansRequest := &lnrpc.PendingChannelsRequest{}
|
||||
pendingChanResp, err := node.PendingChannels(
|
||||
ctx, pendingChansRequest,
|
||||
resp, err := node.PendingChannels(
|
||||
ctx, &lnrpc.PendingChannelsRequest{},
|
||||
)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, pendingClose := range pendingChanResp.WaitingCloseChannels {
|
||||
for _, pendingClose := range resp.WaitingCloseChannels {
|
||||
if pendingClose.Channel.ChannelPoint == chanPointStr {
|
||||
return false
|
||||
}
|
||||
|
|
@ -203,3 +208,34 @@ func assertChannelClosed(ctx context.Context, t *harnessTest,
|
|||
|
||||
return closingTxid
|
||||
}
|
||||
|
||||
func assertSweepExists(t *testing.T, node *HarnessNode,
|
||||
witnessType walletrpc.WitnessType) {
|
||||
|
||||
ctxb := context.Background()
|
||||
err := wait.NoError(func() error {
|
||||
pendingSweeps, err := node.WalletKitClient.PendingSweeps(
|
||||
ctxb, &walletrpc.PendingSweepsRequest{},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, sweep := range pendingSweeps.PendingSweeps {
|
||||
if sweep.WitnessType == witnessType {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("failed to find second level sweep: %v",
|
||||
toProtoJSON(t, pendingSweeps))
|
||||
}, defaultTimeout)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func toProtoJSON(t *testing.T, resp proto.Message) string {
|
||||
jsonBytes, err := taprpc.ProtoJSONMarshalOpts.Marshal(resp)
|
||||
require.NoError(t, err)
|
||||
|
||||
return string(jsonBytes)
|
||||
}
|
||||
|
|
|
|||
2120
itest/assets_test.go
Normal file
2120
itest/assets_test.go
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/lightninglabs/lightning-terminal/litrpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/tapchannelrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
|
|
@ -433,3 +434,44 @@ func getPaymentResult(stream routerrpc.Router_SendPaymentV2Client) (
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getAssetPaymentResult(
|
||||
s tapchannelrpc.TaprootAssetChannels_SendPaymentClient,
|
||||
isHodl bool) (*lnrpc.Payment, error) {
|
||||
|
||||
// No idea why it makes a difference whether we wait before calling
|
||||
// s.Recv() or not, but it does. Without the sleep, the test will fail
|
||||
// with "insufficient local balance"... ¯\_(ツ)_/¯
|
||||
// Probably something weird within lnd itself.
|
||||
time.Sleep(time.Second)
|
||||
|
||||
for {
|
||||
msg, err := s.Recv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Ignore RFQ quote acceptance messages read from the send
|
||||
// payment stream, as they are not relevant.
|
||||
quote := msg.GetAcceptedSellOrder()
|
||||
if quote != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
payment := msg.GetPaymentResult()
|
||||
if payment == nil {
|
||||
return nil, fmt.Errorf("unexpected message: %v", msg)
|
||||
}
|
||||
|
||||
// If this is a hodl payment, then we'll return the first
|
||||
// expected response. Otherwise, we'll wait until the in flight
|
||||
// clears to we can observe the other payment states.
|
||||
switch {
|
||||
case isHodl:
|
||||
return payment, nil
|
||||
|
||||
case payment.Status != lnrpc.Payment_IN_FLIGHT:
|
||||
return payment, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3807
itest/litd_custom_channels_test.go
Normal file
3807
itest/litd_custom_channels_test.go
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -202,7 +202,7 @@ func testFirewallRules(ctx context.Context, net *NetworkHarness,
|
|||
resp, err := net.Alice.GetInfo(ctx, &lnrpc.GetInfoRequest{})
|
||||
require.NoError(t.t, err)
|
||||
require.NotEmpty(t.t, resp.Alias)
|
||||
require.Contains(t.t, resp.Alias, "0")
|
||||
require.Contains(t.t, resp.Alias, "Alice")
|
||||
|
||||
// Open a channel between Alice and Bob so that we have something to
|
||||
// query later.
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ func integratedTestSuite(ctx context.Context, net *NetworkHarness, t *testing.T,
|
|||
resp, err := net.Alice.GetInfo(ctx, &lnrpc.GetInfoRequest{})
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, resp.Alias)
|
||||
require.Contains(t, resp.Alias, "0")
|
||||
require.Contains(t, resp.Alias, "Alice")
|
||||
|
||||
t.Run("certificate check", func(tt *testing.T) {
|
||||
runCertificateCheck(tt, net.Alice)
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ type LitNodeConfig struct {
|
|||
|
||||
LitPort int
|
||||
LitRESTPort int
|
||||
|
||||
// backupDBDir is the path where a database backup is stored, if any.
|
||||
backupDBDir string
|
||||
}
|
||||
|
||||
func (cfg *LitNodeConfig) LitAddr() string {
|
||||
|
|
@ -150,7 +153,7 @@ func (l *litArgs) getArg(name string) (string, bool) {
|
|||
}
|
||||
|
||||
// toArgList converts the litArgs map to an arguments string slice.
|
||||
func (l *litArgs) toArgList() []string {
|
||||
func (l *litArgs) toArgList(nodeName string) []string {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
|
|
@ -164,7 +167,7 @@ func (l *litArgs) toArgList() []string {
|
|||
args = append(args, fmt.Sprintf("--%s=%s", arg, setting))
|
||||
}
|
||||
|
||||
return args
|
||||
return append([]string{"--lnd.alias=" + nodeName}, args...)
|
||||
}
|
||||
|
||||
// LitArgOption defines the signature of a functional option that can be used
|
||||
|
|
@ -197,7 +200,7 @@ func (cfg *LitNodeConfig) GenArgs(opts ...LitArgOption) []string {
|
|||
|
||||
cfg.ActiveArgs = args
|
||||
|
||||
return args.toArgList()
|
||||
return args.toArgList(cfg.Name)
|
||||
}
|
||||
|
||||
// defaultLitArgs generates the default arguments to be used with a Litd node.
|
||||
|
|
@ -216,6 +219,7 @@ func (cfg *LitNodeConfig) defaultLitdArgs() *litArgs {
|
|||
"enablerest": "",
|
||||
"restcors": "*",
|
||||
"lnd.debuglevel": "trace,GRPC=error,PEER=info",
|
||||
"lndconnectinterval": "200ms",
|
||||
}
|
||||
)
|
||||
for _, arg := range cfg.LitArgs {
|
||||
|
|
@ -652,6 +656,9 @@ func (hn *HarnessNode) Start(litdBinary string, litdError chan<- error,
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Starting node=%v, pid=%v\n", hn.Cfg.Name,
|
||||
hn.cmd.Process.Pid)
|
||||
|
||||
// Launch a new goroutine which that bubbles up any potential fatal
|
||||
// process errors to the goroutine running the tests.
|
||||
hn.processExit = make(chan struct{})
|
||||
|
|
@ -2083,3 +2090,38 @@ func connectLitRPC(ctx context.Context, hostPort, tlsCertPath,
|
|||
|
||||
return grpc.DialContext(ctx, hostPort, opts...)
|
||||
}
|
||||
|
||||
// copyAll copies all files and directories from srcDir to dstDir recursively.
|
||||
// Note that this function does not support links.
|
||||
func copyAll(dstDir, srcDir string) error {
|
||||
entries, err := os.ReadDir(srcDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, entry := range entries {
|
||||
srcPath := filepath.Join(srcDir, entry.Name())
|
||||
dstPath := filepath.Join(dstDir, entry.Name())
|
||||
|
||||
info, err := os.Stat(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
err := os.Mkdir(dstPath, info.Mode())
|
||||
if err != nil && !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
err = copyAll(dstPath, srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := CopyFile(dstPath, srcPath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
|
|
@ -56,7 +57,8 @@ func TestLightningTerminal(t *testing.T) {
|
|||
|
||||
// Start a chain backend.
|
||||
chainBackend, _, err := lntest.NewBackend(
|
||||
lndHarness.Miner().P2PAddress(), harnessNetParams,
|
||||
lndHarness.Miner().P2PAddress(),
|
||||
harnessNetParams,
|
||||
)
|
||||
require.NoError(t1, err, "new backend")
|
||||
|
||||
|
|
@ -130,6 +132,10 @@ func (h *harnessTest) setupLogging() {
|
|||
require.NoError(h.t, err)
|
||||
interceptor = &ic
|
||||
|
||||
UseLogger(build.NewSubLogger(Subsystem, func(tag string) btclog.Logger {
|
||||
return logWriter.GenSubLogger(tag, func() {})
|
||||
}))
|
||||
|
||||
err = build.ParseAndSetDebugLevels("debug", logWriter)
|
||||
require.NoError(h.t, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,56 @@ var allTestCases = []*testCase{
|
|||
name: "test large http header",
|
||||
test: testLargeHttpHeader,
|
||||
},
|
||||
{
|
||||
name: "test custom channels",
|
||||
test: testCustomChannels,
|
||||
},
|
||||
{
|
||||
name: "test custom channels large",
|
||||
test: testCustomChannelsLarge,
|
||||
},
|
||||
{
|
||||
name: "test custom channels grouped asset",
|
||||
test: testCustomChannelsGroupedAsset,
|
||||
},
|
||||
{
|
||||
name: "test custom channels force close",
|
||||
test: testCustomChannelsForceClose,
|
||||
},
|
||||
{
|
||||
name: "test custom channels breach",
|
||||
test: testCustomChannelsBreach,
|
||||
},
|
||||
{
|
||||
name: "test custom channels liquidity",
|
||||
test: testCustomChannelsLiquidityEdgeCases,
|
||||
},
|
||||
{
|
||||
name: "test custom channels htlc force close",
|
||||
test: testCustomChannelsHtlcForceClose,
|
||||
},
|
||||
{
|
||||
name: "test custom channels balance consistency",
|
||||
test: testCustomChannelsBalanceConsistency,
|
||||
},
|
||||
{
|
||||
name: "test custom channels single asset multi input",
|
||||
test: testCustomChannelsSingleAssetMultiInput,
|
||||
},
|
||||
{
|
||||
name: "test custom channels oracle pricing",
|
||||
test: testCustomChannelsOraclePricing,
|
||||
},
|
||||
{
|
||||
name: "test custom channels fee",
|
||||
test: testCustomChannelsFee,
|
||||
},
|
||||
{
|
||||
name: "test custom channels forward bandwidth",
|
||||
test: testCustomChannelsForwardBandwidth,
|
||||
},
|
||||
{
|
||||
name: "test custom channels decode payreq",
|
||||
test: testCustomChannelsDecodeAssetInvoice,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
24
itest/log.go
Normal file
24
itest/log.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package itest
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
)
|
||||
|
||||
const Subsystem = "ITST"
|
||||
|
||||
// log is a logger that is initialized with no output filters. This means the
|
||||
// package will not perform any logging by default until the caller requests it.
|
||||
var log btclog.Logger
|
||||
|
||||
// The default amount of logging is none.
|
||||
func init() {
|
||||
UseLogger(build.NewSubLogger(Subsystem, nil))
|
||||
}
|
||||
|
||||
// UseLogger uses a specified Logger to output package logging info.
|
||||
// This should be used in preference to SetLogWriter if the caller is also
|
||||
// using btclog.
|
||||
func UseLogger(logger btclog.Logger) {
|
||||
log = logger
|
||||
}
|
||||
|
|
@ -46,7 +46,8 @@ type NetworkHarness struct {
|
|||
|
||||
// Miner is a reference to a running full node that can be used to create
|
||||
// new blocks on the network.
|
||||
Miner *miner.HarnessMiner
|
||||
Miner *miner.HarnessMiner
|
||||
|
||||
LNDHarness *lntest.HarnessTest
|
||||
|
||||
// server is an instance of the local Loop/Pool mock server.
|
||||
|
|
@ -285,11 +286,14 @@ func (n *NetworkHarness) litArgs() []string {
|
|||
|
||||
// NewNode initializes a new HarnessNode.
|
||||
func (n *NetworkHarness) NewNode(t *testing.T, name string, extraArgs []string,
|
||||
remoteMode bool, wait bool) (*HarnessNode, error) {
|
||||
remoteMode bool, wait bool, additionalLitArgs ...string) (*HarnessNode,
|
||||
error) {
|
||||
|
||||
allLitArgs := append(n.litArgs(), additionalLitArgs...)
|
||||
|
||||
return n.newNode(
|
||||
t, name, extraArgs, n.litArgs(), false, remoteMode, nil,
|
||||
wait, false,
|
||||
t, name, extraArgs, allLitArgs, false, remoteMode, nil, wait,
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -432,6 +436,12 @@ tryconnect:
|
|||
"finish syncing")
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore "already connected to peer" errors.
|
||||
if strings.Contains(err.Error(), "already connected to peer") {
|
||||
return nil
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -764,6 +774,58 @@ func (n *NetworkHarness) StopNode(node *HarnessNode) error {
|
|||
return node.Stop()
|
||||
}
|
||||
|
||||
// StopAndBackupDB backs up the database of the target node.
|
||||
func (n *NetworkHarness) StopAndBackupDB(node *HarnessNode) error {
|
||||
restart, err := n.SuspendNode(node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Backup files.
|
||||
tempDir, err := os.MkdirTemp("", "past-state")
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create temp db folder: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
if err := copyAll(tempDir, node.Cfg.DBDir()); err != nil {
|
||||
return fmt.Errorf("unable to copy database files: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
node.Cfg.backupDBDir = tempDir
|
||||
|
||||
return restart()
|
||||
}
|
||||
|
||||
// StopAndRestoreDB stops the target node, restores the database from a backup
|
||||
// and starts the node again.
|
||||
func (n *NetworkHarness) StopAndRestoreDB(node *HarnessNode) error {
|
||||
restart, err := n.SuspendNode(node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Restore files.
|
||||
if node.Cfg.backupDBDir == "" {
|
||||
return fmt.Errorf("no database backup created")
|
||||
}
|
||||
|
||||
err = copyAll(node.Cfg.DBDir(), node.Cfg.backupDBDir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to copy database files: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
if err := os.RemoveAll(node.Cfg.backupDBDir); err != nil {
|
||||
return fmt.Errorf("unable to remove backup dir: %w",
|
||||
err)
|
||||
}
|
||||
node.Cfg.backupDBDir = ""
|
||||
|
||||
return restart()
|
||||
}
|
||||
|
||||
// OpenChannel attempts to open a channel between srcNode and destNode with the
|
||||
// passed channel funding parameters. If the passed context has a timeout, then
|
||||
// if the timeout is reached before the channel pending notification is
|
||||
|
|
@ -1048,8 +1110,13 @@ func (n *NetworkHarness) CloseChannel(lnNode *HarnessNode,
|
|||
|
||||
err = wait.NoError(func() error {
|
||||
closeReq := &lnrpc.CloseChannelRequest{
|
||||
ChannelPoint: cp, Force: force,
|
||||
ChannelPoint: cp,
|
||||
Force: force,
|
||||
}
|
||||
if !force {
|
||||
closeReq.SatPerVbyte = 5
|
||||
}
|
||||
|
||||
closeRespStream, err = lnNode.CloseChannel(ctx, closeReq)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to close channel: %v", err)
|
||||
|
|
@ -1076,7 +1143,7 @@ func (n *NetworkHarness) CloseChannel(lnNode *HarnessNode,
|
|||
return fmt.Errorf("unable to decode closeTxid: "+
|
||||
"%v", err)
|
||||
}
|
||||
n.LNDHarness.Miner().AssertTxInMempool(closeTxid)
|
||||
n.LNDHarness.Miner().AssertTxInMempool(*closeTxid)
|
||||
|
||||
return nil
|
||||
}, wait.ChannelCloseTimeout)
|
||||
|
|
@ -1092,7 +1159,8 @@ func (n *NetworkHarness) CloseChannel(lnNode *HarnessNode,
|
|||
// passed context has a timeout, then if the timeout is reached before the
|
||||
// notification is received then an error is returned.
|
||||
func (n *NetworkHarness) WaitForChannelClose(
|
||||
closeChanStream lnrpc.Lightning_CloseChannelClient) (*chainhash.Hash, error) {
|
||||
stream lnrpc.Lightning_CloseChannelClient) (*lnrpc.ChannelCloseUpdate,
|
||||
error) {
|
||||
|
||||
ctxb := context.Background()
|
||||
ctx, cancel := context.WithTimeout(ctxb, wait.ChannelCloseTimeout)
|
||||
|
|
@ -1101,13 +1169,14 @@ func (n *NetworkHarness) WaitForChannelClose(
|
|||
errChan := make(chan error)
|
||||
updateChan := make(chan *lnrpc.CloseStatusUpdate_ChanClose)
|
||||
go func() {
|
||||
closeResp, err := closeChanStream.Recv()
|
||||
closeResp, err := stream.Recv()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
|
||||
closeFin, ok := closeResp.Update.(*lnrpc.CloseStatusUpdate_ChanClose)
|
||||
update := closeResp.Update
|
||||
closeFin, ok := update.(*lnrpc.CloseStatusUpdate_ChanClose)
|
||||
if !ok {
|
||||
errChan <- fmt.Errorf("expected channel close update, "+
|
||||
"instead got %v", closeFin)
|
||||
|
|
@ -1125,7 +1194,7 @@ func (n *NetworkHarness) WaitForChannelClose(
|
|||
case err := <-errChan:
|
||||
return nil, err
|
||||
case update := <-updateChan:
|
||||
return chainhash.NewHash(update.ChanClose.ClosingTxid)
|
||||
return update.ChanClose, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1172,6 +1241,33 @@ func (n *NetworkHarness) AssertChannelExists(node *HarnessNode,
|
|||
}, lntest.DefaultTimeout)
|
||||
}
|
||||
|
||||
// AssertNodeKnown makes sure the given node knows about the target node in the
|
||||
// network graph.
|
||||
func (n *NetworkHarness) AssertNodeKnown(node, target *HarnessNode) error {
|
||||
ctxb := context.Background()
|
||||
ctxt, cancel := context.WithTimeout(ctxb, wait.DefaultTimeout)
|
||||
defer cancel()
|
||||
|
||||
req := &lnrpc.NodeInfoRequest{
|
||||
PubKey: hex.EncodeToString(
|
||||
target.PubKey[:],
|
||||
),
|
||||
}
|
||||
return wait.NoError(func() error {
|
||||
info, err := node.GetNodeInfo(ctxt, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if info.Node == nil {
|
||||
return fmt.Errorf("node %x has no info about %x",
|
||||
node.PubKey[:], target.PubKey[:])
|
||||
}
|
||||
|
||||
return nil
|
||||
}, lntest.DefaultTimeout)
|
||||
}
|
||||
|
||||
// DumpLogs reads the current logs generated by the passed node, and returns
|
||||
// the logs as a single string. This function is useful for examining the logs
|
||||
// of a particular node in the case of a test failure.
|
||||
|
|
|
|||
279
itest/oracle_test.go
Normal file
279
itest/oracle_test.go
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
package itest
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/taproot-assets/asset"
|
||||
"github.com/lightninglabs/taproot-assets/rfqmath"
|
||||
"github.com/lightninglabs/taproot-assets/rfqmsg"
|
||||
oraclerpc "github.com/lightninglabs/taproot-assets/taprpc/priceoraclerpc"
|
||||
"github.com/lightningnetwork/lnd/cert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
||||
// oracleHarness is a basic integration test RPC price oracle server harness.
|
||||
type oracleHarness struct {
|
||||
oraclerpc.UnimplementedPriceOracleServer
|
||||
|
||||
listenAddr string
|
||||
|
||||
grpcListener net.Listener
|
||||
grpcServer *grpc.Server
|
||||
|
||||
purchasePrices map[asset.ID]rfqmath.BigIntFixedPoint
|
||||
salePrices map[asset.ID]rfqmath.BigIntFixedPoint
|
||||
}
|
||||
|
||||
func newOracleHarness(listenAddr string) *oracleHarness {
|
||||
return &oracleHarness{
|
||||
listenAddr: listenAddr,
|
||||
purchasePrices: make(map[asset.ID]rfqmath.BigIntFixedPoint),
|
||||
salePrices: make(map[asset.ID]rfqmath.BigIntFixedPoint),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *oracleHarness) setPrice(assetID asset.ID, purchasePrice,
|
||||
salePrice rfqmath.BigIntFixedPoint) {
|
||||
|
||||
o.purchasePrices[assetID] = purchasePrice
|
||||
o.salePrices[assetID] = salePrice
|
||||
}
|
||||
|
||||
func (o *oracleHarness) start(t *testing.T) {
|
||||
// Start the mock RPC price oracle service.
|
||||
//
|
||||
// Generate self-signed certificate. This allows us to use TLS for the
|
||||
// gRPC server.
|
||||
tlsCert, err := generateSelfSignedCert()
|
||||
require.NoError(t, err)
|
||||
|
||||
// Create the gRPC server with TLS
|
||||
transportCredentials := credentials.NewTLS(&tls.Config{
|
||||
Certificates: []tls.Certificate{tlsCert},
|
||||
})
|
||||
o.grpcServer = grpc.NewServer(grpc.Creds(transportCredentials))
|
||||
|
||||
serviceAddr := fmt.Sprintf("rfqrpc://%s", o.listenAddr)
|
||||
log.Infof("Starting RPC price oracle service at address: %s\n",
|
||||
serviceAddr)
|
||||
|
||||
oraclerpc.RegisterPriceOracleServer(o.grpcServer, o)
|
||||
|
||||
go func() {
|
||||
var err error
|
||||
o.grpcListener, err = net.Listen("tcp", o.listenAddr)
|
||||
if err != nil {
|
||||
log.Errorf("Error oracle listening: %v", err)
|
||||
return
|
||||
}
|
||||
if err := o.grpcServer.Serve(o.grpcListener); err != nil {
|
||||
log.Errorf("Error oracle serving: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (o *oracleHarness) stop() {
|
||||
if o.grpcServer != nil {
|
||||
o.grpcServer.Stop()
|
||||
}
|
||||
if o.grpcListener != nil {
|
||||
_ = o.grpcListener.Close()
|
||||
}
|
||||
}
|
||||
|
||||
// getAssetRates returns the asset rates for a given transaction type and
|
||||
// subject asset max amount.
|
||||
func (o *oracleHarness) getAssetRates(id asset.ID,
|
||||
transactionType oraclerpc.TransactionType) (oraclerpc.AssetRates,
|
||||
error) {
|
||||
|
||||
// Determine the rate based on the transaction type.
|
||||
var subjectAssetRate rfqmath.BigIntFixedPoint
|
||||
if transactionType == oraclerpc.TransactionType_PURCHASE {
|
||||
rate, ok := o.purchasePrices[id]
|
||||
if !ok {
|
||||
return oraclerpc.AssetRates{}, fmt.Errorf("purchase "+
|
||||
"price not found for asset ID=%v", id)
|
||||
}
|
||||
subjectAssetRate = rate
|
||||
} else {
|
||||
rate, ok := o.salePrices[id]
|
||||
if !ok {
|
||||
return oraclerpc.AssetRates{}, fmt.Errorf("sale "+
|
||||
"price not found for asset ID=%v", id)
|
||||
}
|
||||
subjectAssetRate = rate
|
||||
}
|
||||
|
||||
// Marshal subject asset rate to RPC format.
|
||||
rpcSubjectAssetToBtcRate, err := oraclerpc.MarshalBigIntFixedPoint(
|
||||
subjectAssetRate,
|
||||
)
|
||||
if err != nil {
|
||||
return oraclerpc.AssetRates{}, err
|
||||
}
|
||||
|
||||
// Marshal payment asset rate to RPC format.
|
||||
rpcPaymentAssetToBtcRate, err := oraclerpc.MarshalBigIntFixedPoint(
|
||||
rfqmsg.MilliSatPerBtc,
|
||||
)
|
||||
if err != nil {
|
||||
return oraclerpc.AssetRates{}, err
|
||||
}
|
||||
|
||||
expiry := time.Now().Add(5 * time.Minute).Unix()
|
||||
return oraclerpc.AssetRates{
|
||||
SubjectAssetRate: rpcSubjectAssetToBtcRate,
|
||||
PaymentAssetRate: rpcPaymentAssetToBtcRate,
|
||||
ExpiryTimestamp: uint64(expiry),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// QueryAssetRates queries the asset rates for a given transaction type, subject
|
||||
// asset, and payment asset. An asset rate is the number of asset units per
|
||||
// BTC.
|
||||
//
|
||||
// Example use case:
|
||||
//
|
||||
// Alice is trying to pay an invoice by spending an asset. Alice therefore
|
||||
// requests that Bob (her asset channel counterparty) purchase the asset from
|
||||
// her. Bob's payment, in BTC, will pay the invoice.
|
||||
//
|
||||
// Alice requests a bid quote from Bob. Her request includes an asset rates hint
|
||||
// (ask). Alice obtains the asset rates hint by calling this endpoint. She sets:
|
||||
// - `SubjectAsset` to the asset she is trying to sell.
|
||||
// - `SubjectAssetMaxAmount` to the max channel asset outbound.
|
||||
// - `PaymentAsset` to BTC.
|
||||
// - `TransactionType` to SALE.
|
||||
// - `AssetRateHint` to nil.
|
||||
//
|
||||
// Bob calls this endpoint to get the bid quote asset rates that he will send as
|
||||
// a response to Alice's request. He sets:
|
||||
// - `SubjectAsset` to the asset that Alice is trying to sell.
|
||||
// - `SubjectAssetMaxAmount` to the value given in Alice's quote request.
|
||||
// - `PaymentAsset` to BTC.
|
||||
// - `TransactionType` to PURCHASE.
|
||||
// - `AssetRateHint` to the value given in Alice's quote request.
|
||||
func (o *oracleHarness) QueryAssetRates(_ context.Context,
|
||||
req *oraclerpc.QueryAssetRatesRequest) (
|
||||
*oraclerpc.QueryAssetRatesResponse, error) {
|
||||
|
||||
// Ensure that the payment asset is BTC. We only support BTC as the
|
||||
// payment asset in this example.
|
||||
if !oraclerpc.IsAssetBtc(req.PaymentAsset) {
|
||||
log.Infof("Payment asset is not BTC: %v", req.PaymentAsset)
|
||||
|
||||
return &oraclerpc.QueryAssetRatesResponse{
|
||||
Result: &oraclerpc.QueryAssetRatesResponse_Error{
|
||||
Error: &oraclerpc.QueryAssetRatesErrResponse{
|
||||
Message: "unsupported payment asset, " +
|
||||
"only BTC is supported",
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Ensure that the subject asset is set correctly.
|
||||
subjectAssetID, err := parseSubjectAsset(req.SubjectAsset)
|
||||
if err != nil {
|
||||
log.Errorf("Error parsing subject asset: %v", err)
|
||||
return nil, fmt.Errorf("error parsing subject asset: %w", err)
|
||||
}
|
||||
|
||||
_, hasPurchase := o.purchasePrices[subjectAssetID]
|
||||
_, hasSale := o.salePrices[subjectAssetID]
|
||||
|
||||
log.Infof("Have for asset=%x, purchase=%v, sale=%v", subjectAssetID[:],
|
||||
hasPurchase, hasSale)
|
||||
|
||||
// Ensure that the subject asset is supported.
|
||||
if !hasPurchase || !hasSale {
|
||||
log.Infof("Unsupported subject asset ID str: %v\n",
|
||||
req.SubjectAsset)
|
||||
|
||||
return &oraclerpc.QueryAssetRatesResponse{
|
||||
Result: &oraclerpc.QueryAssetRatesResponse_Error{
|
||||
Error: &oraclerpc.QueryAssetRatesErrResponse{
|
||||
Message: "unsupported subject asset",
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
assetRates, err := o.getAssetRates(subjectAssetID, req.TransactionType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Infof("QueryAssetRates returning rates (subject_asset_rate=%v, "+
|
||||
"payment_asset_rate=%v)", assetRates.SubjectAssetRate,
|
||||
assetRates.PaymentAssetRate)
|
||||
|
||||
return &oraclerpc.QueryAssetRatesResponse{
|
||||
Result: &oraclerpc.QueryAssetRatesResponse_Ok{
|
||||
Ok: &oraclerpc.QueryAssetRatesOkResponse{
|
||||
AssetRates: &assetRates,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// parseSubjectAsset parses the subject asset from the given asset specifier.
|
||||
func parseSubjectAsset(subjectAsset *oraclerpc.AssetSpecifier) (asset.ID,
|
||||
error) {
|
||||
|
||||
// Ensure that the subject asset is set.
|
||||
if subjectAsset == nil {
|
||||
return asset.ID{}, fmt.Errorf("subject asset is not set (nil)")
|
||||
}
|
||||
|
||||
// Check the subject asset bytes if set.
|
||||
var subjectAssetID asset.ID
|
||||
switch {
|
||||
case len(subjectAsset.GetAssetId()) > 0:
|
||||
copy(subjectAssetID[:], subjectAsset.GetAssetId())
|
||||
|
||||
case len(subjectAsset.GetAssetIdStr()) > 0:
|
||||
assetIDBytes, err := hex.DecodeString(
|
||||
subjectAsset.GetAssetIdStr(),
|
||||
)
|
||||
if err != nil {
|
||||
return asset.ID{}, fmt.Errorf("error decoding asset "+
|
||||
"ID hex string: %w", err)
|
||||
}
|
||||
|
||||
copy(subjectAssetID[:], assetIDBytes)
|
||||
|
||||
default:
|
||||
return asset.ID{}, fmt.Errorf("subject asset ID bytes and ID " +
|
||||
"str not set")
|
||||
}
|
||||
|
||||
return subjectAssetID, nil
|
||||
}
|
||||
|
||||
// generateSelfSignedCert generates a self-signed TLS certificate and private
|
||||
// key.
|
||||
func generateSelfSignedCert() (tls.Certificate, error) {
|
||||
certBytes, keyBytes, err := cert.GenCertPair(
|
||||
"itest price oracle", nil, nil, false, 24*time.Hour,
|
||||
)
|
||||
if err != nil {
|
||||
return tls.Certificate{}, err
|
||||
}
|
||||
|
||||
tlsCert, err := tls.X509KeyPair(certBytes, keyBytes)
|
||||
if err != nil {
|
||||
return tls.Certificate{}, err
|
||||
}
|
||||
|
||||
return tlsCert, nil
|
||||
}
|
||||
|
|
@ -10,6 +10,9 @@ import (
|
|||
"github.com/lightninglabs/taproot-assets/taprpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/mintrpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/priceoraclerpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/tapchannelrpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/universerpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/autopilotrpc"
|
||||
|
|
@ -55,4 +58,7 @@ var Registrations = []StubPackageRegistration{
|
|||
assetwalletrpc.RegisterAssetWalletJSONCallbacks,
|
||||
universerpc.RegisterUniverseJSONCallbacks,
|
||||
mintrpc.RegisterMintJSONCallbacks,
|
||||
priceoraclerpc.RegisterPriceOracleJSONCallbacks,
|
||||
rfqrpc.RegisterRfqJSONCallbacks,
|
||||
tapchannelrpc.RegisterTaprootAssetChannelsJSONCallbacks,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1388,8 +1388,14 @@ enum CommitmentType {
|
|||
A channel that uses musig2 for the funding output, and the new tapscript
|
||||
features where relevant.
|
||||
*/
|
||||
// TODO(roasbeef): need script enforce mirror type for the above as well?
|
||||
SIMPLE_TAPROOT = 5;
|
||||
|
||||
/*
|
||||
Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
|
||||
This channel type also commits to additional meta data in the tapscript
|
||||
leaves for the scripts in a channel.
|
||||
*/
|
||||
SIMPLE_TAPROOT_OVERLAY = 6;
|
||||
}
|
||||
|
||||
message ChannelConstraints {
|
||||
|
|
@ -1592,6 +1598,11 @@ message Channel {
|
|||
the channel's operation.
|
||||
*/
|
||||
string memo = 36;
|
||||
|
||||
/*
|
||||
Custom channel data that might be populated in custom channels.
|
||||
*/
|
||||
bytes custom_channel_data = 37;
|
||||
}
|
||||
|
||||
message ListChannelsRequest {
|
||||
|
|
@ -2028,10 +2039,38 @@ message ChannelOpenUpdate {
|
|||
ChannelPoint channel_point = 1;
|
||||
}
|
||||
|
||||
message CloseOutput {
|
||||
// The amount in satoshi of this close output. This amount is the final
|
||||
// commitment balance of the channel and the actual amount paid out on chain
|
||||
// might be smaller due to subtracted fees.
|
||||
int64 amount_sat = 1 [jstype = JS_STRING];
|
||||
|
||||
// The pkScript of the close output.
|
||||
bytes pk_script = 2;
|
||||
|
||||
// Whether this output is for the local or remote node.
|
||||
bool is_local = 3;
|
||||
|
||||
// The TLV encoded custom channel data records for this output, which might
|
||||
// be set for custom channels.
|
||||
bytes custom_channel_data = 4;
|
||||
}
|
||||
|
||||
message ChannelCloseUpdate {
|
||||
bytes closing_txid = 1;
|
||||
|
||||
bool success = 2;
|
||||
|
||||
// The local channel close output. If the local channel balance was dust to
|
||||
// begin with, this output will not be set.
|
||||
CloseOutput local_close_output = 3;
|
||||
|
||||
// The remote channel close output. If the remote channel balance was dust
|
||||
// to begin with, this output will not be set.
|
||||
CloseOutput remote_close_output = 4;
|
||||
|
||||
// Any additional outputs that might be added for custom channel types.
|
||||
repeated CloseOutput additional_outputs = 5;
|
||||
}
|
||||
|
||||
message CloseChannelRequest {
|
||||
|
|
@ -2709,6 +2748,11 @@ message PendingChannelsResponse {
|
|||
impacts the channel's operation.
|
||||
*/
|
||||
string memo = 13;
|
||||
|
||||
/*
|
||||
Custom channel data that might be populated in custom channels.
|
||||
*/
|
||||
bytes custom_channel_data = 34;
|
||||
}
|
||||
|
||||
message PendingOpenChannel {
|
||||
|
|
@ -2968,6 +3012,12 @@ message ChannelBalanceResponse {
|
|||
|
||||
// Sum of channels pending remote balances.
|
||||
Amount pending_open_remote_balance = 8;
|
||||
|
||||
/*
|
||||
Custom channel data that might be populated if there are custom channels
|
||||
present.
|
||||
*/
|
||||
bytes custom_channel_data = 9;
|
||||
}
|
||||
|
||||
message QueryRoutesRequest {
|
||||
|
|
@ -3293,6 +3343,20 @@ message Route {
|
|||
The total amount in millisatoshis.
|
||||
*/
|
||||
int64 total_amt_msat = 6 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The actual on-chain amount that was sent out to the first hop. This value is
|
||||
only different from the total_amt_msat field if this is a custom channel
|
||||
payment and the value transported in the HTLC is different from the BTC
|
||||
amount in the HTLC. If this value is zero, then this is an old payment that
|
||||
didn't have this value yet and can be ignored.
|
||||
*/
|
||||
int64 first_hop_amount_msat = 7 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
Custom channel data that might be populated in custom channels.
|
||||
*/
|
||||
bytes custom_channel_data = 8;
|
||||
}
|
||||
|
||||
message NodeInfoRequest {
|
||||
|
|
@ -3922,6 +3986,11 @@ message InvoiceHTLC {
|
|||
|
||||
// Details relevant to AMP HTLCs, only populated if this is an AMP HTLC.
|
||||
AMP amp = 11;
|
||||
|
||||
/*
|
||||
Custom channel data that might be populated in custom channels.
|
||||
*/
|
||||
bytes custom_channel_data = 12;
|
||||
}
|
||||
|
||||
// Details specific to AMP HTLCs.
|
||||
|
|
@ -4162,6 +4231,12 @@ message Payment {
|
|||
uint64 payment_index = 15 [jstype = JS_STRING];
|
||||
|
||||
PaymentFailureReason failure_reason = 16;
|
||||
|
||||
/*
|
||||
The custom TLV records that were sent to the first hop as part of the HTLC
|
||||
wire message for this payment.
|
||||
*/
|
||||
map<uint64, bytes> first_hop_custom_records = 17;
|
||||
}
|
||||
|
||||
message HTLCAttempt {
|
||||
|
|
|
|||
568
proto/loop.proto
568
proto/loop.proto
|
|
@ -89,6 +89,12 @@ service SwapClient {
|
|||
*/
|
||||
rpc GetLsatTokens (TokensRequest) returns (TokensResponse);
|
||||
|
||||
/* loop: `fetchl402`
|
||||
FetchL402Token fetches an L402 token from the server, this is required in
|
||||
order to receive reservation notifications from the server.
|
||||
*/
|
||||
rpc FetchL402Token (FetchL402TokenRequest) returns (FetchL402TokenResponse);
|
||||
|
||||
/* loop: `getinfo`
|
||||
GetInfo gets basic information about the loop daemon.
|
||||
*/
|
||||
|
|
@ -143,6 +149,51 @@ service SwapClient {
|
|||
*/
|
||||
rpc ListInstantOuts (ListInstantOutsRequest)
|
||||
returns (ListInstantOutsResponse);
|
||||
|
||||
/* loop: `static newstaticaddress`
|
||||
NewStaticAddress requests a new static address for loop-ins from the server.
|
||||
*/
|
||||
rpc NewStaticAddress (NewStaticAddressRequest)
|
||||
returns (NewStaticAddressResponse);
|
||||
|
||||
/* loop: `static listunspentdeposits`
|
||||
ListUnspentDeposits returns a list of utxos deposited at a static address.
|
||||
*/
|
||||
rpc ListUnspentDeposits (ListUnspentDepositsRequest)
|
||||
returns (ListUnspentDepositsResponse);
|
||||
|
||||
/* loop:`static withdraw`
|
||||
WithdrawDeposits withdraws a selection or all deposits of a static address.
|
||||
*/
|
||||
rpc WithdrawDeposits (WithdrawDepositsRequest)
|
||||
returns (WithdrawDepositsResponse);
|
||||
|
||||
/* loop:`listdeposits`
|
||||
ListStaticAddressDeposits returns a list of filtered static address
|
||||
deposits.
|
||||
*/
|
||||
rpc ListStaticAddressDeposits (ListStaticAddressDepositsRequest)
|
||||
returns (ListStaticAddressDepositsResponse);
|
||||
|
||||
/* loop:`listswaps`
|
||||
ListStaticAddressSwaps returns a list of filtered static address
|
||||
swaps.
|
||||
*/
|
||||
rpc ListStaticAddressSwaps (ListStaticAddressSwapsRequest)
|
||||
returns (ListStaticAddressSwapsResponse);
|
||||
|
||||
/* loop:`static summary`
|
||||
GetStaticAddressSummary returns a summary of static address related
|
||||
statistics.
|
||||
*/
|
||||
rpc GetStaticAddressSummary (StaticAddressSummaryRequest)
|
||||
returns (StaticAddressSummaryResponse);
|
||||
|
||||
/* loop:`static`
|
||||
StaticAddressLoopIn initiates a static address loop-in swap.
|
||||
*/
|
||||
rpc StaticAddressLoopIn (StaticAddressLoopInRequest)
|
||||
returns (StaticAddressLoopInResponse);
|
||||
}
|
||||
|
||||
message LoopOutRequest {
|
||||
|
|
@ -735,6 +786,13 @@ message QuoteRequest {
|
|||
probing and payment.
|
||||
*/
|
||||
bool private = 7;
|
||||
|
||||
/*
|
||||
Static address deposit outpoints that will be quoted for. This option only
|
||||
pertains to loop in swaps. Either this or the amt parameter can be set at
|
||||
the same time.
|
||||
*/
|
||||
repeated string deposit_outpoints = 8;
|
||||
}
|
||||
|
||||
message InQuoteResponse {
|
||||
|
|
@ -830,6 +888,12 @@ message TokensResponse {
|
|||
repeated L402Token tokens = 1;
|
||||
}
|
||||
|
||||
message FetchL402TokenRequest {
|
||||
}
|
||||
|
||||
message FetchL402TokenResponse {
|
||||
}
|
||||
|
||||
message L402Token {
|
||||
/*
|
||||
The base macaroon that was baked by the auth server.
|
||||
|
|
@ -1326,20 +1390,24 @@ message ClientReservation {
|
|||
The state the reservation is in.
|
||||
*/
|
||||
string state = 2;
|
||||
|
||||
/*
|
||||
The amount that the reservation is for.
|
||||
The amount that the reservation is for.
|
||||
*/
|
||||
uint64 amount = 3 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The transaction id of the reservation.
|
||||
The transaction id of the reservation.
|
||||
*/
|
||||
string tx_id = 4;
|
||||
|
||||
/*
|
||||
The vout of the reservation.
|
||||
The vout of the reservation.
|
||||
*/
|
||||
uint32 vout = 5;
|
||||
|
||||
/*
|
||||
The expiry of the reservation.
|
||||
The expiry of the reservation.
|
||||
*/
|
||||
uint32 expiry = 6;
|
||||
}
|
||||
|
|
@ -1369,10 +1437,12 @@ message InstantOutResponse {
|
|||
The hash of the swap preimage.
|
||||
*/
|
||||
bytes instant_out_hash = 1;
|
||||
|
||||
/*
|
||||
The transaction id of the sweep transaction.
|
||||
*/
|
||||
string sweep_tx_id = 2;
|
||||
|
||||
/*
|
||||
The state of the swap.
|
||||
*/
|
||||
|
|
@ -1440,3 +1510,493 @@ message InstantOut {
|
|||
*/
|
||||
string sweep_tx_id = 5;
|
||||
}
|
||||
|
||||
message NewStaticAddressRequest {
|
||||
/*
|
||||
The client's public key for the 2-of-2 MuSig2 taproot static address.
|
||||
*/
|
||||
bytes client_key = 1;
|
||||
}
|
||||
|
||||
message NewStaticAddressResponse {
|
||||
/*
|
||||
The taproot static address.
|
||||
*/
|
||||
string address = 1;
|
||||
|
||||
/*
|
||||
The CSV expiry of the static address.
|
||||
*/
|
||||
uint32 expiry = 2;
|
||||
}
|
||||
|
||||
message ListUnspentDepositsRequest {
|
||||
/*
|
||||
The number of minimum confirmations a utxo must have to be listed.
|
||||
*/
|
||||
int32 min_confs = 1;
|
||||
|
||||
/*
|
||||
The number of maximum confirmations a utxo may have to be listed. A zero
|
||||
value indicates that there is no maximum.
|
||||
*/
|
||||
int32 max_confs = 2;
|
||||
}
|
||||
|
||||
message ListUnspentDepositsResponse {
|
||||
/*
|
||||
A list of utxos behind the static address.
|
||||
*/
|
||||
repeated Utxo utxos = 1;
|
||||
}
|
||||
|
||||
message Utxo {
|
||||
/*
|
||||
The static address of the utxo.
|
||||
*/
|
||||
string static_address = 1;
|
||||
|
||||
/*
|
||||
The value of the unspent coin in satoshis.
|
||||
*/
|
||||
int64 amount_sat = 2 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The outpoint in the form txid:index.
|
||||
*/
|
||||
string outpoint = 3;
|
||||
|
||||
/*
|
||||
The number of confirmations for the Utxo.
|
||||
*/
|
||||
int64 confirmations = 4 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
message WithdrawDepositsRequest {
|
||||
/*
|
||||
The outpoints of the deposits to withdraw.
|
||||
*/
|
||||
repeated OutPoint outpoints = 1;
|
||||
|
||||
/*
|
||||
If set to true, all deposits will be withdrawn.
|
||||
*/
|
||||
bool all = 2;
|
||||
|
||||
/*
|
||||
The address to withdraw the funds to.
|
||||
*/
|
||||
string dest_addr = 3;
|
||||
|
||||
/*
|
||||
The fee rate in sat/vbyte to use for the withdrawal transaction.
|
||||
*/
|
||||
int64 sat_per_vbyte = 4 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
message WithdrawDepositsResponse {
|
||||
/*
|
||||
The transaction hash of the withdrawal transaction.
|
||||
*/
|
||||
string withdrawal_tx_hash = 1;
|
||||
|
||||
/*
|
||||
The pkscript of the withdrawal transaction.
|
||||
*/
|
||||
string pk_script = 2;
|
||||
}
|
||||
|
||||
message OutPoint {
|
||||
/*
|
||||
Raw bytes representing the transaction id.
|
||||
*/
|
||||
bytes txid_bytes = 1;
|
||||
|
||||
/*
|
||||
Reversed, hex-encoded string representing the transaction id.
|
||||
*/
|
||||
string txid_str = 2;
|
||||
|
||||
/*
|
||||
The index of the output on the transaction.
|
||||
*/
|
||||
uint32 output_index = 3;
|
||||
}
|
||||
|
||||
message ListStaticAddressDepositsRequest {
|
||||
/*
|
||||
Filters the list of all stored deposits by deposit state.
|
||||
*/
|
||||
DepositState state_filter = 1;
|
||||
|
||||
/*
|
||||
Filters the list of all stored deposits by the outpoint.
|
||||
*/
|
||||
repeated string outpoints = 2;
|
||||
}
|
||||
|
||||
message ListStaticAddressDepositsResponse {
|
||||
/*
|
||||
A list of all deposits that match the filtered state.
|
||||
*/
|
||||
repeated Deposit filtered_deposits = 1;
|
||||
}
|
||||
|
||||
message ListStaticAddressSwapsRequest {
|
||||
}
|
||||
|
||||
message ListStaticAddressSwapsResponse {
|
||||
/*
|
||||
A list of all swaps known static address loop-in swaps.
|
||||
*/
|
||||
repeated StaticAddressLoopInSwap swaps = 1;
|
||||
}
|
||||
|
||||
message StaticAddressSummaryRequest {
|
||||
}
|
||||
|
||||
message StaticAddressSummaryResponse {
|
||||
/*
|
||||
The static address of the client.
|
||||
*/
|
||||
string static_address = 1;
|
||||
|
||||
/*
|
||||
The CSV expiry of the static address.
|
||||
*/
|
||||
uint64 relative_expiry_blocks = 2 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total number of deposits.
|
||||
*/
|
||||
uint32 total_num_deposits = 3;
|
||||
|
||||
/*
|
||||
The total value of unconfirmed deposits.
|
||||
*/
|
||||
int64 value_unconfirmed_satoshis = 4 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total value of confirmed deposits.
|
||||
*/
|
||||
int64 value_deposited_satoshis = 5 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total value of all expired deposits.
|
||||
*/
|
||||
int64 value_expired_satoshis = 6 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total value of all deposits that have been withdrawn.
|
||||
*/
|
||||
int64 value_withdrawn_satoshis = 7 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total value of all loop-ins that have been finalized.
|
||||
*/
|
||||
int64 value_looped_in_satoshis = 8 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The total value of all htlc timeout sweeps that the client swept.
|
||||
*/
|
||||
int64 value_htlc_timeout_sweeps_satoshis = 9 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
enum DepositState {
|
||||
/*
|
||||
UNKNOWN_STATE is the default state of a deposit.
|
||||
*/
|
||||
UNKNOWN_STATE = 0;
|
||||
|
||||
/*
|
||||
DEPOSITED indicates that the deposit has been sufficiently confirmed on
|
||||
chain.
|
||||
*/
|
||||
DEPOSITED = 1;
|
||||
|
||||
/*
|
||||
WITHDRAWING indicates that the deposit is currently being withdrawn. It
|
||||
flips to WITHDRAWN once the withdrawal transaction has been sufficiently
|
||||
confirmed.
|
||||
*/
|
||||
WITHDRAWING = 2;
|
||||
|
||||
/*
|
||||
WITHDRAWN indicates that the deposit has been withdrawn.
|
||||
*/
|
||||
WITHDRAWN = 3;
|
||||
|
||||
/*
|
||||
LOOPING_IN indicates that the deposit is currently being used in a static
|
||||
address loop-in swap.
|
||||
*/
|
||||
LOOPING_IN = 4;
|
||||
|
||||
/*
|
||||
LOOPED_IN indicates that the deposit was used in a static address loop-in
|
||||
swap.
|
||||
*/
|
||||
LOOPED_IN = 5;
|
||||
|
||||
/*
|
||||
SWEEP_HTLC_TIMEOUT indicates that the deposit is part of an active loop-in
|
||||
of which the respective htlc was published by the server and the timeout
|
||||
path has opened up for the client to sweep.
|
||||
*/
|
||||
SWEEP_HTLC_TIMEOUT = 6;
|
||||
|
||||
/*
|
||||
HTLC_TIMEOUT_SWEPT indicates that the timeout path of the htlc has been
|
||||
swept by the client.
|
||||
*/
|
||||
HTLC_TIMEOUT_SWEPT = 7;
|
||||
|
||||
/*
|
||||
PUBLISH_EXPIRED indicates that the deposit has expired and the sweep
|
||||
transaction has been published.
|
||||
*/
|
||||
PUBLISH_EXPIRED = 8;
|
||||
|
||||
/*
|
||||
WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep
|
||||
transaction has not yet been sufficiently confirmed.
|
||||
*/
|
||||
WAIT_FOR_EXPIRY_SWEEP = 9;
|
||||
|
||||
/*
|
||||
EXPIRED indicates that the deposit has expired and the sweep transaction
|
||||
has been sufficiently confirmed.
|
||||
*/
|
||||
EXPIRED = 10;
|
||||
}
|
||||
|
||||
message Deposit {
|
||||
/*
|
||||
The identifier of the deposit.
|
||||
*/
|
||||
bytes id = 1;
|
||||
|
||||
/*
|
||||
The state of the deposit.
|
||||
*/
|
||||
DepositState state = 2;
|
||||
|
||||
/*
|
||||
The outpoint of the deposit in format txid:index.
|
||||
*/
|
||||
string outpoint = 3;
|
||||
|
||||
/*
|
||||
The value of the deposit in satoshis.
|
||||
*/
|
||||
int64 value = 4 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The block height at which the deposit was confirmed.
|
||||
*/
|
||||
int64 confirmation_height = 5 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The number of blocks that are left until the deposit cannot be used for a
|
||||
loop-in swap anymore.
|
||||
*/
|
||||
int64 blocks_until_expiry = 6 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
message StaticAddressLoopInSwap {
|
||||
/*
|
||||
The swap hash of the swap. It represents the unique identifier of the swap.
|
||||
*/
|
||||
bytes swap_hash = 1;
|
||||
|
||||
/*
|
||||
*/
|
||||
repeated string deposit_outpoints = 2;
|
||||
|
||||
/*
|
||||
*/
|
||||
StaticAddressLoopInSwapState state = 3;
|
||||
|
||||
/*
|
||||
The swap amount of the swap. It is the sum of the values of the deposit
|
||||
outpoints that were used for this swap.
|
||||
*/
|
||||
int64 swap_amount_satoshis = 4 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The invoiced swap amount. It is the swap amount minus the quoted server
|
||||
fees.
|
||||
*/
|
||||
int64 payment_request_amount_satoshis = 5 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
enum StaticAddressLoopInSwapState {
|
||||
/*
|
||||
*/
|
||||
UNKNOWN_STATIC_ADDRESS_SWAP_STATE = 0;
|
||||
|
||||
/*
|
||||
*/
|
||||
INIT_HTLC = 1;
|
||||
|
||||
/*
|
||||
*/
|
||||
SIGN_HTLC_TX = 2;
|
||||
|
||||
/*
|
||||
*/
|
||||
MONITOR_INVOICE_HTLC_TX = 3;
|
||||
|
||||
/*
|
||||
*/
|
||||
PAYMENT_RECEIVED = 4;
|
||||
|
||||
/*
|
||||
*/
|
||||
SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT = 5;
|
||||
|
||||
/*
|
||||
*/
|
||||
MONITOR_HTLC_TIMEOUT_SWEEP = 6;
|
||||
|
||||
/*
|
||||
*/
|
||||
HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT = 7;
|
||||
|
||||
/*
|
||||
*/
|
||||
SUCCEEDED = 8;
|
||||
|
||||
/*
|
||||
*/
|
||||
SUCCEEDED_TRANSITIONING_FAILED = 9;
|
||||
|
||||
/*
|
||||
*/
|
||||
UNLOCK_DEPOSITS = 10;
|
||||
|
||||
/*
|
||||
*/
|
||||
FAILED_STATIC_ADDRESS_SWAP = 11;
|
||||
}
|
||||
|
||||
message StaticAddressLoopInRequest {
|
||||
/*
|
||||
The outpoints of the deposits to loop-in.
|
||||
*/
|
||||
repeated string outpoints = 1;
|
||||
|
||||
/*
|
||||
Maximum satoshis we are willing to pay the server for the swap. This value
|
||||
is not disclosed in the swap initiation call, but if the server asks for a
|
||||
higher fee, we abort the swap. Typically this value is taken from the
|
||||
response of the GetQuote call.
|
||||
*/
|
||||
int64 max_swap_fee_satoshis = 2 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
Optionally the client can specify the last hop pubkey when requesting a
|
||||
loop-in quote. This is useful to get better off-chain routing fee from the
|
||||
server.
|
||||
*/
|
||||
bytes last_hop = 3;
|
||||
|
||||
/*
|
||||
An optional label for this swap. This field is limited to 500 characters and
|
||||
may not be one of the reserved values in loop/labels Reserved list.
|
||||
*/
|
||||
string label = 4;
|
||||
|
||||
/*
|
||||
An optional identification string that will be appended to the user agent
|
||||
string sent to the server to give information about the usage of loop. This
|
||||
initiator part is meant for user interfaces to add their name to give the
|
||||
full picture of the binary used (loopd, LiT) and the method used for
|
||||
triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
|
||||
*/
|
||||
string initiator = 5;
|
||||
|
||||
/*
|
||||
Optional route hints to reach the destination through private channels.
|
||||
*/
|
||||
repeated looprpc.RouteHint route_hints = 6;
|
||||
|
||||
/*
|
||||
Private indicates whether the destination node should be considered private.
|
||||
In which case, loop will generate hop hints to assist with probing and
|
||||
payment.
|
||||
*/
|
||||
bool private = 7;
|
||||
|
||||
/*
|
||||
The swap payment timeout allows the user to specify an upper limit for the
|
||||
amount of time the server is allowed to take to fulfill the off-chain swap
|
||||
payment. If the timeout is reached the swap will be aborted on the server
|
||||
side and the client can retry the swap with different parameters.
|
||||
*/
|
||||
uint32 payment_timeout_seconds = 8;
|
||||
}
|
||||
|
||||
message StaticAddressLoopInResponse {
|
||||
/*
|
||||
The swap hash that identifies this swap.
|
||||
*/
|
||||
bytes swap_hash = 1;
|
||||
|
||||
/*
|
||||
The state the swap is in.
|
||||
*/
|
||||
string state = 2;
|
||||
|
||||
/*
|
||||
The amount of the swap.
|
||||
*/
|
||||
uint64 amount = 3 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The htlc cltv expiry height of the swap.
|
||||
*/
|
||||
int32 htlc_cltv = 4;
|
||||
|
||||
/*
|
||||
The quoted swap fee in satoshis.
|
||||
*/
|
||||
int64 quoted_swap_fee_satoshis = 5 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The maximum total swap fee the client is willing to pay for the swap.
|
||||
*/
|
||||
int64 max_swap_fee_satoshis = 6 [jstype = JS_STRING];
|
||||
|
||||
/*
|
||||
The block height at which the swap was initiated.
|
||||
*/
|
||||
uint32 initiation_height = 7;
|
||||
|
||||
/*
|
||||
The static address protocol version.
|
||||
*/
|
||||
string protocol_version = 8;
|
||||
|
||||
/*
|
||||
An optional label for this swap.
|
||||
*/
|
||||
string label = 9;
|
||||
|
||||
/*
|
||||
An optional identification string that will be appended to the user agent
|
||||
string sent to the server to give information about the usage of loop. This
|
||||
initiator part is meant for user interfaces to add their name to give the
|
||||
full picture of the binary used (loopd, LiT) and the method used for
|
||||
triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
|
||||
*/
|
||||
string initiator = 10;
|
||||
|
||||
/*
|
||||
The swap payment timeout allows the user to specify an upper limit for the
|
||||
amount of time the server is allowed to take to fulfill the off-chain swap
|
||||
payment. If the timeout is reached the swap will be aborted on the server
|
||||
side and the client can retry the swap with different parameters.
|
||||
*/
|
||||
uint32 payment_timeout_seconds = 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,11 +289,10 @@ message ServerLoopInQuoteRequest {
|
|||
// litd/v0.2.0-alpha/commit=326d754
|
||||
string user_agent = 6;
|
||||
|
||||
// If this is a quote request for a static address loop in, this value
|
||||
// defines the number of static address deposits that the client wants to
|
||||
// quote for. The amount of the quote reflects the sum of all deposits. The
|
||||
// number of deposits here is taken into consideration for the total swap
|
||||
// fee.
|
||||
// The number of static address deposits the client wants to quote for.
|
||||
// If the number of deposits exceeds one the server will apply a per-input
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
@ -668,69 +667,23 @@ message SubscribeNotificationsRequest {
|
|||
message SubscribeNotificationsResponse {
|
||||
oneof notification {
|
||||
ServerReservationNotification reservation_notification = 1;
|
||||
ServerStaticLoopInSweepNotification static_loop_in_sweep = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// StaticAddressProtocolVersion represents the static address protocol version
|
||||
// the client adheres to.
|
||||
enum StaticAddressProtocolVersion {
|
||||
// V0 is the initially released static address protocol version.
|
||||
V0 = 0;
|
||||
}
|
||||
|
||||
service StaticAddressServer {
|
||||
// ServerNewAddress generates a new static address for the client to use.
|
||||
// The server will generate the address and return the server key and the
|
||||
// address's CSV expiry.
|
||||
rpc ServerNewAddress (ServerNewAddressRequest)
|
||||
returns (ServerNewAddressResponse);
|
||||
|
||||
// ServerWithdrawDeposits allows to cooperatively sweep deposits that
|
||||
// haven't timed out yet to the client's wallet. The server will generate
|
||||
// the partial sigs for the client's selected deposits.
|
||||
rpc ServerWithdrawDeposits (ServerWithdrawRequest)
|
||||
returns (ServerWithdrawResponse);
|
||||
}
|
||||
|
||||
message ServerNewAddressRequest {
|
||||
// The protocol version that the client adheres to.
|
||||
StaticAddressProtocolVersion protocol_version = 1;
|
||||
|
||||
// The client key for the MuSig2 static address output.
|
||||
bytes client_key = 2;
|
||||
}
|
||||
|
||||
message ServerNewAddressResponse {
|
||||
ServerAddressParameters params = 1;
|
||||
}
|
||||
|
||||
message ServerAddressParameters {
|
||||
// The server key for the MuSig2 static address output.
|
||||
bytes server_key = 1;
|
||||
|
||||
// The CSV expiry of the static address output.
|
||||
uint32 expiry = 2;
|
||||
}
|
||||
|
||||
message ServerWithdrawRequest {
|
||||
// The deposit outpoints the client wishes to close.
|
||||
repeated PrevoutInfo outpoints = 1;
|
||||
|
||||
// The nonces that the client used to generate the coop close tx sigs.
|
||||
repeated bytes client_nonces = 2;
|
||||
|
||||
// The address that the client wants to sweep the static address deposits
|
||||
// to.
|
||||
string client_sweep_addr = 3;
|
||||
|
||||
// The fee rate in sat/kw that the client wants to use for the sweep.
|
||||
uint64 tx_fee_rate = 4 [jstype = JS_STRING];
|
||||
}
|
||||
|
||||
message ServerWithdrawResponse {
|
||||
// The sweep sigs that the server generated for the htlc.
|
||||
repeated bytes musig2_sweep_sigs = 1;
|
||||
|
||||
// The nonces that the server used to generate the sweepless sweep sigs.
|
||||
repeated bytes server_nonces = 2;
|
||||
// ServerStaticLoopInSweepNotification is a request from the server to the
|
||||
// client to cosign a transaction that contains deposits from a finished static
|
||||
// loop ins.
|
||||
message ServerStaticLoopInSweepNotification {
|
||||
// The psbt of the sweep transaction.
|
||||
bytes sweep_tx_psbt = 1;
|
||||
|
||||
// The swap hash the deposits are associated with.
|
||||
bytes swap_hash = 2;
|
||||
|
||||
// The map of deposit txid:idx to the nonce used by the server.
|
||||
map<string, bytes> deposit_to_nonces = 3;
|
||||
|
||||
// The prevout information of the sweep txn.
|
||||
repeated PrevoutInfo prevout_info = 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/lightninglabs/faraday/frdrpcserver"
|
||||
"github.com/lightninglabs/faraday/frdrpcserver/perms"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
"github.com/lightninglabs/taproot-assets/fn"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"google.golang.org/grpc"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
|
|
@ -126,3 +127,13 @@ func (f *faradaySubServer) Permissions() map[string][]bakery.Op {
|
|||
func (f *faradaySubServer) WhiteListedURLs() map[string]struct{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Impl returns the actual implementation of the sub-server. This might not be
|
||||
// set if the sub-server is running in remote mode.
|
||||
func (f *faradaySubServer) Impl() fn.Option[any] {
|
||||
if f.RPCServer == nil {
|
||||
return fn.None[any]()
|
||||
}
|
||||
|
||||
return fn.Some[any](f.RPCServer)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
restProxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
"github.com/lightninglabs/taproot-assets/fn"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
"google.golang.org/grpc"
|
||||
|
|
@ -62,4 +63,8 @@ type SubServer interface {
|
|||
// WhiteListedURLs returns a map of all the sub-server's URLs that can
|
||||
// be accessed without a macaroon.
|
||||
WhiteListedURLs() map[string]struct{}
|
||||
|
||||
// Impl returns the actual implementation of the sub-server. This might
|
||||
// not be set if the sub-server is running in remote mode.
|
||||
Impl() fn.Option[any]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/lightninglabs/loop/loopd"
|
||||
"github.com/lightninglabs/loop/loopd/perms"
|
||||
"github.com/lightninglabs/loop/looprpc"
|
||||
"github.com/lightninglabs/taproot-assets/fn"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"google.golang.org/grpc"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
|
|
@ -136,3 +137,13 @@ func (l *loopSubServer) Permissions() map[string][]bakery.Op {
|
|||
func (l *loopSubServer) WhiteListedURLs() map[string]struct{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Impl returns the actual implementation of the sub-server. This might not be
|
||||
// set if the sub-server is running in remote mode.
|
||||
func (l *loopSubServer) Impl() fn.Option[any] {
|
||||
if l.Daemon == nil {
|
||||
return fn.None[any]()
|
||||
}
|
||||
|
||||
return fn.Some[any](l.Daemon)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,19 @@ func (s *Manager) AddServer(ss SubServer, enable bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetServer returns the sub-server with the given name if it exists.
|
||||
func (s *Manager) GetServer(name string) (SubServer, bool) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
ss, ok := s.servers[name]
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
return ss.SubServer, true
|
||||
}
|
||||
|
||||
// StartIntegratedServers starts all the manager's sub-servers that should be
|
||||
// started in integrated mode.
|
||||
func (s *Manager) StartIntegratedServers(lndClient lnrpc.LightningClient,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/lightninglabs/pool"
|
||||
"github.com/lightninglabs/pool/perms"
|
||||
"github.com/lightninglabs/pool/poolrpc"
|
||||
"github.com/lightninglabs/taproot-assets/fn"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"google.golang.org/grpc"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
|
|
@ -126,3 +127,13 @@ func (p *poolSubServer) Permissions() map[string][]bakery.Op {
|
|||
func (p *poolSubServer) WhiteListedURLs() map[string]struct{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Impl returns the actual implementation of the sub-server. This might not be
|
||||
// set if the sub-server is running in remote mode.
|
||||
func (p *poolSubServer) Impl() fn.Option[any] {
|
||||
if p.Server == nil {
|
||||
return fn.None[any]()
|
||||
}
|
||||
|
||||
return fn.Some[any](p.Server)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/lightninglabs/lndclient"
|
||||
tap "github.com/lightninglabs/taproot-assets"
|
||||
"github.com/lightninglabs/taproot-assets/address"
|
||||
"github.com/lightninglabs/taproot-assets/fn"
|
||||
"github.com/lightninglabs/taproot-assets/perms"
|
||||
"github.com/lightninglabs/taproot-assets/tapcfg"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc"
|
||||
|
|
@ -103,9 +104,10 @@ func (t *taprootAssetsSubServer) Start(_ lnrpc.LightningClient,
|
|||
return err
|
||||
}
|
||||
|
||||
// The taproot asset channel feature is still experimental, so we
|
||||
// disable it for now.
|
||||
const enableChannelFeatures = false
|
||||
// If we're being called here, it means tapd is running in integrated
|
||||
// mode. But we can only offer Taproot Asset channel functionality if
|
||||
// lnd is also running in integrated mode.
|
||||
enableChannelFeatures := !t.lndRemote
|
||||
|
||||
err = tapcfg.ConfigureSubServer(
|
||||
t.Server, t.cfg, log, &lndGrpc.LndServices,
|
||||
|
|
@ -176,6 +178,20 @@ func (t *taprootAssetsSubServer) RegisterRestService(ctx context.Context,
|
|||
return err
|
||||
}
|
||||
|
||||
err = rfqrpc.RegisterRfqHandlerFromEndpoint(
|
||||
ctx, mux, endpoint, dialOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tchrpc.RegisterTaprootAssetChannelsHandlerFromEndpoint(
|
||||
ctx, mux, endpoint, dialOpts,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = universerpc.RegisterUniverseHandlerFromEndpoint(
|
||||
ctx, mux, endpoint, dialOpts,
|
||||
)
|
||||
|
|
@ -238,3 +254,13 @@ func (t *taprootAssetsSubServer) WhiteListedURLs() map[string]struct{} {
|
|||
t.cfg.RpcConf.AllowPublicStats || t.remote,
|
||||
)
|
||||
}
|
||||
|
||||
// Impl returns the actual implementation of the sub-server. This might not be
|
||||
// set if the sub-server is running in remote mode.
|
||||
func (t *taprootAssetsSubServer) Impl() fn.Option[any] {
|
||||
if t.Server == nil {
|
||||
return fn.None[any]()
|
||||
}
|
||||
|
||||
return fn.Some[any](t.Server)
|
||||
}
|
||||
|
|
|
|||
103
terminal.go
103
terminal.go
|
|
@ -34,9 +34,13 @@ import (
|
|||
"github.com/lightninglabs/lightning-terminal/status"
|
||||
"github.com/lightninglabs/lightning-terminal/subservers"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
taprootassets "github.com/lightninglabs/taproot-assets"
|
||||
"github.com/lightningnetwork/lnd"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
"github.com/lightningnetwork/lnd/chainreg"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/funding"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
|
|
@ -49,10 +53,14 @@ import (
|
|||
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/wtclientrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/btcwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
"github.com/lightningnetwork/lnd/msgmux"
|
||||
"github.com/lightningnetwork/lnd/rpcperms"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
"github.com/lightningnetwork/lnd/sweep"
|
||||
grpcProxy "github.com/mwitkow/grpc-proxy/proxy"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
|
@ -509,6 +517,25 @@ func (g *LightningTerminal) start() error {
|
|||
}},
|
||||
}
|
||||
|
||||
var auxComponents lnd.AuxComponents
|
||||
switch g.cfg.TaprootAssetsMode {
|
||||
case ModeRemote, ModeDisable:
|
||||
log.Warnf("Taproot Assets daemon is either disabled " +
|
||||
"or running in remote mode. Taproot Asset " +
|
||||
"channel functionality will NOT be " +
|
||||
"available. To enable, set Taproot Assets " +
|
||||
"mode to 'integrated' in the config file.")
|
||||
|
||||
case ModeIntegrated:
|
||||
components, err := g.buildAuxComponents()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not build aux "+
|
||||
"components: %w", err)
|
||||
}
|
||||
|
||||
auxComponents = *components
|
||||
}
|
||||
|
||||
implCfg := &lnd.ImplementationCfg{
|
||||
GrpcRegistrar: g,
|
||||
RestRegistrar: g,
|
||||
|
|
@ -516,6 +543,7 @@ func (g *LightningTerminal) start() error {
|
|||
DatabaseBuilder: g.defaultImplCfg.DatabaseBuilder,
|
||||
WalletConfigBuilder: g,
|
||||
ChainControlBuilder: g.defaultImplCfg.ChainControlBuilder,
|
||||
AuxComponents: auxComponents,
|
||||
}
|
||||
|
||||
g.wg.Add(1)
|
||||
|
|
@ -783,7 +811,7 @@ func (g *LightningTerminal) setUpLNDClients(lndQuit chan struct{}) error {
|
|||
case <-interceptor.ShutdownChannel():
|
||||
return fmt.Errorf("received the shutdown signal")
|
||||
|
||||
case <-time.After(defaultStartupTimeout):
|
||||
case <-time.After(g.cfg.LndConnectInterval):
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
@ -865,17 +893,20 @@ func (g *LightningTerminal) setUpLNDClients(lndQuit chan struct{}) error {
|
|||
for {
|
||||
g.lndClient, err = lndclient.NewLndServices(
|
||||
&lndclient.LndServicesConfig{
|
||||
LndAddress: host,
|
||||
Network: network,
|
||||
TLSPath: tlsPath,
|
||||
Insecure: insecure,
|
||||
CustomMacaroonPath: macPath,
|
||||
CustomMacaroonHex: hex.EncodeToString(macData),
|
||||
LndAddress: host,
|
||||
Network: network,
|
||||
TLSPath: tlsPath,
|
||||
Insecure: insecure,
|
||||
CustomMacaroonPath: macPath,
|
||||
CustomMacaroonHex: hex.EncodeToString(
|
||||
macData,
|
||||
),
|
||||
BlockUntilChainSynced: true,
|
||||
BlockUntilUnlocked: true,
|
||||
CallerCtx: ctxc,
|
||||
CheckVersion: minimalCompatibleVersion,
|
||||
RPCTimeout: g.cfg.LndRPCTimeout,
|
||||
ChainSyncPollInterval: g.cfg.LndConnectInterval,
|
||||
},
|
||||
)
|
||||
if err == nil {
|
||||
|
|
@ -1284,17 +1315,71 @@ func (g *LightningTerminal) Permissions() map[string][]bakery.Op {
|
|||
//
|
||||
// NOTE: This is part of the lnd.WalletConfigBuilder interface.
|
||||
func (g *LightningTerminal) BuildWalletConfig(ctx context.Context,
|
||||
dbs *lnd.DatabaseInstances, interceptorChain *rpcperms.InterceptorChain,
|
||||
dbs *lnd.DatabaseInstances, auxComponents *lnd.AuxComponents,
|
||||
interceptorChain *rpcperms.InterceptorChain,
|
||||
grpcListeners []*lnd.ListenerWithSignal) (*chainreg.PartialChainControl,
|
||||
*btcwallet.Config, func(), error) {
|
||||
|
||||
g.lndInterceptorChain = interceptorChain
|
||||
|
||||
return g.defaultImplCfg.WalletConfigBuilder.BuildWalletConfig(
|
||||
ctx, dbs, interceptorChain, grpcListeners,
|
||||
ctx, dbs, auxComponents, interceptorChain, grpcListeners,
|
||||
)
|
||||
}
|
||||
|
||||
// buildAuxComponent builds the auxiliary components required by lnd when
|
||||
// running in integrated mode with tapd being the service that provides the
|
||||
// aux component implementations.
|
||||
func (g *LightningTerminal) buildAuxComponents() (*lnd.AuxComponents, error) {
|
||||
errNotAvailable := fmt.Errorf("tapd is not available, both lnd and " +
|
||||
"tapd must be started in integrated mode for Taproot " +
|
||||
"Assets Channels to be available")
|
||||
|
||||
tapdWrapper, available := g.subServerMgr.GetServer(subservers.TAP)
|
||||
if !available {
|
||||
return nil, errNotAvailable
|
||||
}
|
||||
|
||||
if tapdWrapper.Remote() {
|
||||
return nil, errNotAvailable
|
||||
}
|
||||
|
||||
tapdOpt := tapdWrapper.Impl()
|
||||
tapdAny, err := tapdOpt.UnwrapOrErr(errors.New("tapd not available"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tapd, ok := tapdAny.(*taprootassets.Server)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("tapd is not of the expected type")
|
||||
}
|
||||
|
||||
router := msgmux.NewMultiMsgRouter()
|
||||
router.Start()
|
||||
err = router.RegisterEndpoint(tapd)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error registering tapd endpoint: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
return &lnd.AuxComponents{
|
||||
AuxLeafStore: fn.Some[lnwallet.AuxLeafStore](tapd),
|
||||
MsgRouter: fn.Some[msgmux.Router](router),
|
||||
AuxFundingController: fn.Some[funding.AuxFundingController](
|
||||
tapd,
|
||||
),
|
||||
AuxSigner: fn.Some[lnwallet.AuxSigner](tapd),
|
||||
TrafficShaper: fn.Some[htlcswitch.AuxTrafficShaper](tapd),
|
||||
AuxDataParser: fn.Some[lnd.AuxDataParser](tapd),
|
||||
AuxChanCloser: fn.Some[chancloser.AuxChanCloser](tapd),
|
||||
AuxSweeper: fn.Some[sweep.AuxSweeper](tapd),
|
||||
AuxContractResolver: fn.Some[lnwallet.AuxContractResolver](
|
||||
tapd,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// shutdownSubServers stops all subservers that were started and attached to
|
||||
// lnd.
|
||||
func (g *LightningTerminal) shutdownSubServers() error {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
|
|||
// versioning 2.0.0 spec (http://semver.org/).
|
||||
const (
|
||||
appMajor uint = 0
|
||||
appMinor uint = 13
|
||||
appPatch uint = 6
|
||||
appMinor uint = 14
|
||||
appPatch uint = 0
|
||||
|
||||
// appPreRelease MUST only contain characters from semanticAlphabet per
|
||||
// the semantic versioning spec.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue