Skip to content

Commit ce854ee

Browse files
committed
WIP: update lnd to 0-19-staging-rebased branch
1 parent 1edd3ae commit ce854ee

File tree

20 files changed

+812
-15
lines changed

20 files changed

+812
-15
lines changed

lib/types/proto/lnd/invoicesrpc/invoices.ts

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,50 @@ export interface LookupInvoiceMsg {
121121
lookupModifier: LookupModifier;
122122
}
123123

124+
/** CircuitKey is a unique identifier for an HTLC. */
125+
export interface CircuitKey {
126+
/** / The id of the channel that the is part of this circuit. */
127+
chanId: string;
128+
/** / The index of the incoming htlc in the incoming channel. */
129+
htlcId: string;
130+
}
131+
132+
export interface HtlcModifyRequest {
133+
/**
134+
* The invoice the intercepted HTLC is attempting to settle. The HTLCs in
135+
* the invoice are only HTLCs that have already been accepted or settled,
136+
* not including the current intercepted HTLC.
137+
*/
138+
invoice: Invoice | undefined;
139+
/** The unique identifier of the HTLC of this intercepted HTLC. */
140+
exitHtlcCircuitKey: CircuitKey | undefined;
141+
/** The amount in milli-satoshi that the exit HTLC is attempting to pay. */
142+
exitHtlcAmt: string;
143+
/** The absolute expiry height of the exit HTLC. */
144+
exitHtlcExpiry: number;
145+
/** The current block height. */
146+
currentHeight: number;
147+
/** The wire message custom records of the exit HTLC. */
148+
exitHtlcWireCustomRecords: { [key: string]: Uint8Array | string };
149+
}
150+
151+
export interface HtlcModifyRequest_ExitHtlcWireCustomRecordsEntry {
152+
key: string;
153+
value: Uint8Array | string;
154+
}
155+
156+
export interface HtlcModifyResponse {
157+
/** The circuit key of the HTLC that the client wants to modify. */
158+
circuitKey: CircuitKey | undefined;
159+
/**
160+
* The modified amount in milli-satoshi that the exit HTLC is paying. This
161+
* value can be different from the actual on-chain HTLC amount, in case the
162+
* HTLC carries other valuable items, as can be the case with custom channel
163+
* types. In order to not modify this value, the client should set it zero.
164+
*/
165+
amtPaid: string;
166+
}
167+
124168
/**
125169
* Invoices is a service that can be used to create, accept, settle and cancel
126170
* invoices.
@@ -162,10 +206,21 @@ export interface Invoices {
162206
request?: DeepPartial<SettleInvoiceMsg>
163207
): Promise<SettleInvoiceResp>;
164208
/**
165-
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
209+
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
166210
* using either its payment hash, payment address, or set ID.
167211
*/
168212
lookupInvoiceV2(request?: DeepPartial<LookupInvoiceMsg>): Promise<Invoice>;
213+
/**
214+
* HtlcModifier is a bidirectional streaming RPC that allows a client to
215+
* intercept and modify the HTLCs that attempt to settle the given invoice. The
216+
* server will send HTLCs of invoices to the client and the client can modify
217+
* some aspects of the HTLC in order to pass the invoice acceptance tests.
218+
*/
219+
htlcModifier(
220+
request?: DeepPartial<HtlcModifyResponse>,
221+
onMessage?: (msg: HtlcModifyRequest) => void,
222+
onError?: (err: Error) => void
223+
): void;
169224
}
170225

171226
type Builtin =

lib/types/proto/lnd/lightning.ts

Lines changed: 106 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,17 @@ export enum CommitmentType {
7373
* channel before its maturity date.
7474
*/
7575
SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE',
76-
/** SIMPLE_TAPROOT - TODO(roasbeef): need script enforce mirror type for the above as well? */
76+
/**
77+
* SIMPLE_TAPROOT - A channel that uses musig2 for the funding output, and the new tapscript
78+
* features where relevant.
79+
*/
7780
SIMPLE_TAPROOT = 'SIMPLE_TAPROOT',
81+
/**
82+
* SIMPLE_TAPROOT_OVERLAY - Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
83+
* This channel type also commits to additional meta data in the tapscript
84+
* leaves for the scripts in a channel.
85+
*/
86+
SIMPLE_TAPROOT_OVERLAY = 'SIMPLE_TAPROOT_OVERLAY',
7887
UNRECOGNIZED = 'UNRECOGNIZED'
7988
}
8089

@@ -164,6 +173,8 @@ export enum PaymentFailureReason {
164173
FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 'FAILURE_REASON_INCORRECT_PAYMENT_DETAILS',
165174
/** FAILURE_REASON_INSUFFICIENT_BALANCE - Insufficient local balance. */
166175
FAILURE_REASON_INSUFFICIENT_BALANCE = 'FAILURE_REASON_INSUFFICIENT_BALANCE',
176+
/** FAILURE_REASON_CANCELED - The payment was canceled. */
177+
FAILURE_REASON_CANCELED = 'FAILURE_REASON_CANCELED',
167178
UNRECOGNIZED = 'UNRECOGNIZED'
168179
}
169180

@@ -729,9 +740,8 @@ export interface SendCoinsRequest {
729740
*/
730741
satPerByte: string;
731742
/**
732-
* If set, then the amount field will be ignored, and lnd will attempt to
733-
* send all the coins under control of the internal wallet to the specified
734-
* address.
743+
* If set, the amount field should be unset. It indicates lnd will send all
744+
* wallet coins or all selected coins to the specified address.
735745
*/
736746
sendAll: boolean;
737747
/** An optional label for the transaction, limited to 500 characters. */
@@ -745,6 +755,8 @@ export interface SendCoinsRequest {
745755
spendUnconfirmed: boolean;
746756
/** The strategy to use for selecting coins. */
747757
coinSelectionStrategy: CoinSelectionStrategy;
758+
/** A list of selected outpoints as inputs for the transaction. */
759+
outpoints: OutPoint[];
748760
}
749761

750762
export interface SendCoinsResponse {
@@ -1027,6 +1039,8 @@ export interface Channel {
10271039
* the channel's operation.
10281040
*/
10291041
memo: string;
1042+
/** Custom channel data that might be populated in custom channels. */
1043+
customChannelData: Uint8Array | string;
10301044
}
10311045

10321046
export interface ListChannelsRequest {
@@ -1356,9 +1370,39 @@ export interface ChannelOpenUpdate {
13561370
channelPoint: ChannelPoint | undefined;
13571371
}
13581372

1373+
export interface CloseOutput {
1374+
/**
1375+
* The amount in satoshi of this close output. This amount is the final
1376+
* commitment balance of the channel and the actual amount paid out on chain
1377+
* might be smaller due to subtracted fees.
1378+
*/
1379+
amountSat: string;
1380+
/** The pkScript of the close output. */
1381+
pkScript: Uint8Array | string;
1382+
/** Whether this output is for the local or remote node. */
1383+
isLocal: boolean;
1384+
/**
1385+
* The TLV encoded custom channel data records for this output, which might
1386+
* be set for custom channels.
1387+
*/
1388+
customChannelData: Uint8Array | string;
1389+
}
1390+
13591391
export interface ChannelCloseUpdate {
13601392
closingTxid: Uint8Array | string;
13611393
success: boolean;
1394+
/**
1395+
* The local channel close output. If the local channel balance was dust to
1396+
* begin with, this output will not be set.
1397+
*/
1398+
localCloseOutput: CloseOutput | undefined;
1399+
/**
1400+
* The remote channel close output. If the remote channel balance was dust
1401+
* to begin with, this output will not be set.
1402+
*/
1403+
remoteCloseOutput: CloseOutput | undefined;
1404+
/** Any additional outputs that might be added for custom channel types. */
1405+
additionalOutputs: CloseOutput[];
13621406
}
13631407

13641408
export interface CloseChannelRequest {
@@ -1991,6 +2035,8 @@ export interface PendingChannelsResponse_PendingChannel {
19912035
* impacts the channel's operation.
19922036
*/
19932037
memo: string;
2038+
/** Custom channel data that might be populated in custom channels. */
2039+
customChannelData: Uint8Array | string;
19942040
}
19952041

19962042
export interface PendingChannelsResponse_PendingOpenChannel {
@@ -2212,6 +2258,11 @@ export interface ChannelBalanceResponse {
22122258
pendingOpenLocalBalance: Amount | undefined;
22132259
/** Sum of channels pending remote balances. */
22142260
pendingOpenRemoteBalance: Amount | undefined;
2261+
/**
2262+
* Custom channel data that might be populated if there are custom channels
2263+
* present.
2264+
*/
2265+
customChannelData: Uint8Array | string;
22152266
}
22162267

22172268
export interface QueryRoutesRequest {
@@ -2666,6 +2717,11 @@ export interface ChanInfoRequest {
26662717
* output index for the channel.
26672718
*/
26682719
chanId: string;
2720+
/**
2721+
* The channel point of the channel in format funding_txid:output_index. If
2722+
* chan_id is specified, this field is ignored.
2723+
*/
2724+
chanPoint: string;
26692725
}
26702726

26712727
export interface NetworkInfoRequest {}
@@ -3006,6 +3062,17 @@ export interface Invoice {
30063062
* Note: Output only, don't specify for creating an invoice.
30073063
*/
30083064
ampInvoiceState: { [key: string]: AMPInvoiceState };
3065+
/**
3066+
* Signals that the invoice should include blinded paths to hide the true
3067+
* identity of the recipient.
3068+
*/
3069+
isBlinded: boolean;
3070+
/**
3071+
* Config values to use when creating blinded paths for this invoice. These
3072+
* can be used to override the defaults config values provided in by the
3073+
* global config. This field is only used if is_blinded is true.
3074+
*/
3075+
blindedPathConfig: BlindedPathConfig | undefined;
30093076
}
30103077

30113078
export enum Invoice_InvoiceState {
@@ -3026,6 +3093,30 @@ export interface Invoice_AmpInvoiceStateEntry {
30263093
value: AMPInvoiceState | undefined;
30273094
}
30283095

3096+
export interface BlindedPathConfig {
3097+
/**
3098+
* The minimum number of real hops to include in a blinded path. This doesn't
3099+
* include our node, so if the minimum is 1, then the path will contain at
3100+
* minimum our node along with an introduction node hop. If it is zero then
3101+
* the shortest path will use our node as an introduction node.
3102+
*/
3103+
minNumRealHops?: number | undefined;
3104+
/**
3105+
* The number of hops to include in a blinded path. This doesn't include our
3106+
* node, so if it is 1, then the path will contain our node along with an
3107+
* introduction node or dummy node hop. If paths shorter than NumHops is
3108+
* found, then they will be padded using dummy hops.
3109+
*/
3110+
numHops?: number | undefined;
3111+
/** The maximum number of blinded paths to select and add to an invoice. */
3112+
maxNumPaths?: number | undefined;
3113+
/**
3114+
* A list of node IDs of nodes that should not be used in any of our generated
3115+
* blinded paths.
3116+
*/
3117+
nodeOmissionList: Uint8Array | string[];
3118+
}
3119+
30293120
/** Details of an HTLC that paid to an invoice */
30303121
export interface InvoiceHTLC {
30313122
/** Short channel id over which the htlc was received. */
@@ -3050,13 +3141,23 @@ export interface InvoiceHTLC {
30503141
mppTotalAmtMsat: string;
30513142
/** Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. */
30523143
amp: AMP | undefined;
3144+
/**
3145+
* Custom tlv records that were only sent on the p2p wire message, not in
3146+
* the onion.
3147+
*/
3148+
wireCustomRecords: { [key: string]: Uint8Array | string };
30533149
}
30543150

30553151
export interface InvoiceHTLC_CustomRecordsEntry {
30563152
key: string;
30573153
value: Uint8Array | string;
30583154
}
30593155

3156+
export interface InvoiceHTLC_WireCustomRecordsEntry {
3157+
key: string;
3158+
value: Uint8Array | string;
3159+
}
3160+
30603161
/** Details specific to AMP HTLCs. */
30613162
export interface AMP {
30623163
/**
@@ -3408,6 +3509,7 @@ export interface PayReq {
34083509
paymentAddr: Uint8Array | string;
34093510
numMsat: string;
34103511
features: { [key: number]: Feature };
3512+
blindedPaths: BlindedPaymentPath[];
34113513
}
34123514

34133515
export interface PayReq_FeaturesEntry {

0 commit comments

Comments
 (0)