Skip to content

Commit b04a8d0

Browse files
Merge pull request #38 from lightninglabs/0-19-staging
lnc-core: update version to v0.3.3-alpha
2 parents 1bfb704 + f323b47 commit b04a8d0

File tree

54 files changed

+11913
-688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+11913
-688
lines changed

lib/api/tapd.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { serviceNames as sn } from '../types/proto/schema';
22
import { AssetWallet } from '../types/proto/tapd/assetwalletrpc/assetwallet';
33
import { Mint } from '../types/proto/tapd/mintrpc/mint';
4+
import { PriceOracle } from '../types/proto/tapd/priceoraclerpc/price_oracle';
5+
import { Rfq } from '../types/proto/tapd/rfqrpc/rfq';
6+
import { TaprootAssetChannels } from '../types/proto/tapd/tapchannelrpc/tapchannel';
7+
import { TapDev } from '../types/proto/tapd/tapdevrpc/tapdev';
48
import { TaprootAssets } from '../types/proto/tapd/taprootassets';
59
import { Universe } from '../types/proto/tapd/universerpc/universe';
610

@@ -11,12 +15,23 @@ class TaprootAssetsApi {
1115
taprootAssets: TaprootAssets;
1216
assetWallet: AssetWallet;
1317
mint: Mint;
18+
priceOracle: PriceOracle;
19+
rfq: Rfq;
20+
tapChannels: TaprootAssetChannels;
21+
tapDev: TapDev;
1422
universe: Universe;
1523

1624
constructor(createRpc: Function, lnc: any) {
1725
this.taprootAssets = createRpc(sn.taprpc.TaprootAssets, lnc);
18-
this.mint = createRpc(sn.mintrpc.Mint, lnc);
1926
this.assetWallet = createRpc(sn.assetwalletrpc.AssetWallet, lnc);
27+
this.mint = createRpc(sn.mintrpc.Mint, lnc);
28+
this.priceOracle = createRpc(sn.priceoraclerpc.PriceOracle, lnc);
29+
this.rfq = createRpc(sn.rfqrpc.Rfq, lnc);
30+
this.tapChannels = createRpc(
31+
sn.tapchannelrpc.TaprootAssetChannels,
32+
lnc
33+
);
34+
this.tapDev = createRpc(sn.tapdevrpc.TapDev, lnc);
2035
this.universe = createRpc(sn.universerpc.Universe, lnc);
2136
}
2237
}

lib/types/proto/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import * as looprpc from './looprpc';
1313
import * as poolrpc from './poolrpc';
1414
import * as assetwalletrpc from './assetwalletrpc';
1515
import * as mintrpc from './mintrpc';
16+
import * as priceoraclerpc from './priceoraclerpc';
17+
import * as rfqrpc from './rfqrpc';
18+
import * as tapchannelrpc from './tapchannelrpc';
19+
import * as tapdevrpc from './tapdevrpc';
1620
import * as taprpc from './taprpc';
1721
import * as universerpc from './universerpc';
1822
export {
@@ -31,6 +35,10 @@ export {
3135
poolrpc,
3236
assetwalletrpc,
3337
mintrpc,
38+
priceoraclerpc,
39+
rfqrpc,
40+
tapchannelrpc,
41+
tapdevrpc,
3442
taprpc,
3543
universerpc
3644
};

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

+63-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,57 @@ 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.
164+
*/
165+
amtPaid?: string | undefined;
166+
/**
167+
* This flag indicates whether the HTLCs associated with the invoices should
168+
* be cancelled. The interceptor client may set this field if some
169+
* unexpected behavior is encountered. Setting this will ignore the amt_paid
170+
* field.
171+
*/
172+
cancelSet: boolean;
173+
}
174+
124175
/**
125176
* Invoices is a service that can be used to create, accept, settle and cancel
126177
* invoices.
@@ -162,10 +213,21 @@ export interface Invoices {
162213
request?: DeepPartial<SettleInvoiceMsg>
163214
): Promise<SettleInvoiceResp>;
164215
/**
165-
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
216+
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
166217
* using either its payment hash, payment address, or set ID.
167218
*/
168219
lookupInvoiceV2(request?: DeepPartial<LookupInvoiceMsg>): Promise<Invoice>;
220+
/**
221+
* HtlcModifier is a bidirectional streaming RPC that allows a client to
222+
* intercept and modify the HTLCs that attempt to settle the given invoice. The
223+
* server will send HTLCs of invoices to the client and the client can modify
224+
* some aspects of the HTLC in order to pass the invoice acceptance tests.
225+
*/
226+
htlcModifier(
227+
request?: DeepPartial<HtlcModifyResponse>,
228+
onMessage?: (msg: HtlcModifyRequest) => void,
229+
onError?: (err: Error) => void
230+
): void;
169231
}
170232

171233
type Builtin =

lib/types/proto/lnd/lightning.ts

+118-4
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 {
@@ -2507,6 +2558,16 @@ export interface Route {
25072558
totalFeesMsat: string;
25082559
/** The total amount in millisatoshis. */
25092560
totalAmtMsat: string;
2561+
/**
2562+
* The actual on-chain amount that was sent out to the first hop. This value is
2563+
* only different from the total_amt_msat field if this is a custom channel
2564+
* payment and the value transported in the HTLC is different from the BTC
2565+
* amount in the HTLC. If this value is zero, then this is an old payment that
2566+
* didn't have this value yet and can be ignored.
2567+
*/
2568+
firstHopAmountMsat: string;
2569+
/** Custom channel data that might be populated in custom channels. */
2570+
customChannelData: Uint8Array | string;
25102571
}
25112572

25122573
export interface NodeInfoRequest {
@@ -2666,6 +2727,11 @@ export interface ChanInfoRequest {
26662727
* output index for the channel.
26672728
*/
26682729
chanId: string;
2730+
/**
2731+
* The channel point of the channel in format funding_txid:output_index. If
2732+
* chan_id is specified, this field is ignored.
2733+
*/
2734+
chanPoint: string;
26692735
}
26702736

26712737
export interface NetworkInfoRequest {}
@@ -3006,6 +3072,17 @@ export interface Invoice {
30063072
* Note: Output only, don't specify for creating an invoice.
30073073
*/
30083074
ampInvoiceState: { [key: string]: AMPInvoiceState };
3075+
/**
3076+
* Signals that the invoice should include blinded paths to hide the true
3077+
* identity of the recipient.
3078+
*/
3079+
isBlinded: boolean;
3080+
/**
3081+
* Config values to use when creating blinded paths for this invoice. These
3082+
* can be used to override the defaults config values provided in by the
3083+
* global config. This field is only used if is_blinded is true.
3084+
*/
3085+
blindedPathConfig: BlindedPathConfig | undefined;
30093086
}
30103087

30113088
export enum Invoice_InvoiceState {
@@ -3026,6 +3103,30 @@ export interface Invoice_AmpInvoiceStateEntry {
30263103
value: AMPInvoiceState | undefined;
30273104
}
30283105

3106+
export interface BlindedPathConfig {
3107+
/**
3108+
* The minimum number of real hops to include in a blinded path. This doesn't
3109+
* include our node, so if the minimum is 1, then the path will contain at
3110+
* minimum our node along with an introduction node hop. If it is zero then
3111+
* the shortest path will use our node as an introduction node.
3112+
*/
3113+
minNumRealHops?: number | undefined;
3114+
/**
3115+
* The number of hops to include in a blinded path. This doesn't include our
3116+
* node, so if it is 1, then the path will contain our node along with an
3117+
* introduction node or dummy node hop. If paths shorter than NumHops is
3118+
* found, then they will be padded using dummy hops.
3119+
*/
3120+
numHops?: number | undefined;
3121+
/** The maximum number of blinded paths to select and add to an invoice. */
3122+
maxNumPaths?: number | undefined;
3123+
/**
3124+
* A list of node IDs of nodes that should not be used in any of our generated
3125+
* blinded paths.
3126+
*/
3127+
nodeOmissionList: Uint8Array | string[];
3128+
}
3129+
30293130
/** Details of an HTLC that paid to an invoice */
30303131
export interface InvoiceHTLC {
30313132
/** Short channel id over which the htlc was received. */
@@ -3050,6 +3151,8 @@ export interface InvoiceHTLC {
30503151
mppTotalAmtMsat: string;
30513152
/** Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. */
30523153
amp: AMP | undefined;
3154+
/** Custom channel data that might be populated in custom channels. */
3155+
customChannelData: Uint8Array | string;
30533156
}
30543157

30553158
export interface InvoiceHTLC_CustomRecordsEntry {
@@ -3232,6 +3335,11 @@ export interface Payment {
32323335
*/
32333336
paymentIndex: string;
32343337
failureReason: PaymentFailureReason;
3338+
/**
3339+
* The custom TLV records that were sent to the first hop as part of the HTLC
3340+
* wire message for this payment.
3341+
*/
3342+
firstHopCustomRecords: { [key: string]: Uint8Array | string };
32353343
}
32363344

32373345
export enum Payment_PaymentStatus {
@@ -3252,6 +3360,11 @@ export enum Payment_PaymentStatus {
32523360
UNRECOGNIZED = 'UNRECOGNIZED'
32533361
}
32543362

3363+
export interface Payment_FirstHopCustomRecordsEntry {
3364+
key: string;
3365+
value: Uint8Array | string;
3366+
}
3367+
32553368
export interface HTLCAttempt {
32563369
/** The unique ID that is used for this attempt. */
32573370
attemptId: string;
@@ -3408,6 +3521,7 @@ export interface PayReq {
34083521
paymentAddr: Uint8Array | string;
34093522
numMsat: string;
34103523
features: { [key: number]: Feature };
3524+
blindedPaths: BlindedPaymentPath[];
34113525
}
34123526

34133527
export interface PayReq_FeaturesEntry {

0 commit comments

Comments
 (0)