Skip to content

Commit b2a4bfc

Browse files
authored
Merge pull request #14 from lightninglabs/update-protos-0323
proto: update all protos to the latest releases
2 parents eeb6c19 + c887777 commit b2a4bfc

Some content is hidden

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

57 files changed

+2116
-267
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.github/**
22
dist/**
3-
lib/types/**
43
package-lock.json
54
package.json
65
README.md

lib/types/proto/autopilotrpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './lnd/autopilotrpc/autopilot';
1+
export * from './lnd/autopilotrpc/autopilot';

lib/types/proto/chainrpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './lnd/chainrpc/chainnotifier';
1+
export * from './lnd/chainrpc/chainnotifier';

lib/types/proto/faraday/faraday.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,21 +508,27 @@ export interface FaradayServer {
508508
* Example request:
509509
* http://localhost:8466/v1/faraday/exchangerate
510510
*/
511-
exchangeRate(request?: DeepPartial<ExchangeRateRequest>): Promise<ExchangeRateResponse>;
511+
exchangeRate(
512+
request?: DeepPartial<ExchangeRateRequest>
513+
): Promise<ExchangeRateResponse>;
512514
/**
513515
* Get a report of your node's activity over a period.
514516
*
515517
* Example request:
516518
* http://localhost:8466/v1/faraday/nodeaudit
517519
*/
518-
nodeAudit(request?: DeepPartial<NodeAuditRequest>): Promise<NodeAuditResponse>;
520+
nodeAudit(
521+
request?: DeepPartial<NodeAuditRequest>
522+
): Promise<NodeAuditResponse>;
519523
/**
520524
* Get a channel close report for a specific channel.
521525
*
522526
* Example request:
523527
* http://localhost:8466/v1/faraday/closereport
524528
*/
525-
closeReport(request?: DeepPartial<CloseReportRequest>): Promise<CloseReportResponse>;
529+
closeReport(
530+
request?: DeepPartial<CloseReportRequest>
531+
): Promise<CloseReportResponse>;
526532
}
527533

528534
type Builtin =
@@ -543,4 +549,3 @@ type DeepPartial<T> = T extends Builtin
543549
: T extends {}
544550
? { [K in keyof T]?: DeepPartial<T[K]> }
545551
: Partial<T>;
546-

lib/types/proto/frdrpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './faraday/faraday';
1+
export * from './faraday/faraday';

lib/types/proto/index.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@ import * as watchtowerrpc from './watchtowerrpc';
1111
import * as wtclientrpc from './wtclientrpc';
1212
import * as looprpc from './looprpc';
1313
import * as poolrpc from './poolrpc';
14-
export { frdrpc, litrpc, autopilotrpc, chainrpc, invoicesrpc, lnrpc, routerrpc, signrpc, walletrpc, watchtowerrpc, wtclientrpc, looprpc, poolrpc };
14+
export {
15+
frdrpc,
16+
litrpc,
17+
autopilotrpc,
18+
chainrpc,
19+
invoicesrpc,
20+
lnrpc,
21+
routerrpc,
22+
signrpc,
23+
walletrpc,
24+
watchtowerrpc,
25+
wtclientrpc,
26+
looprpc,
27+
poolrpc
28+
};

lib/types/proto/invoicesrpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './lnd/invoicesrpc/invoices';
1+
export * from './lnd/invoicesrpc/invoices';

lib/types/proto/lit/firewall.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,27 @@ export interface Action {
138138
}
139139

140140
export interface Firewall {
141-
listActions(request?: DeepPartial<ListActionsRequest>): Promise<ListActionsResponse>;
141+
/**
142+
* litcli: `actions`
143+
* ListActions will return a list of actions that have been performed on the
144+
* node. The actions that will be persisted depends on the value of the
145+
* `--firewall.request-logger.level` config option. The default value of the
146+
* option is the "interceptor" mode which will persist only the actions (with
147+
* all request parameters) made with macaroons with caveats that force them
148+
* to be checked by an rpc middleware interceptor. If the "all" mode is used
149+
* then all actions will be persisted but only full request parameters will
150+
* only be stored if the actions are interceptor actions, otherwise only the
151+
* URI and timestamp of the actions will be stored. The "full" mode will
152+
* persist all request data for all actions.
153+
*/
154+
listActions(
155+
request?: DeepPartial<ListActionsRequest>
156+
): Promise<ListActionsResponse>;
157+
/**
158+
* litcli: `privacy`
159+
* PrivacyMapConversion can be used map real values to their pseudo
160+
* counterpart and vice versa.
161+
*/
142162
privacyMapConversion(
143163
request?: DeepPartial<PrivacyMapConversionRequest>
144164
): Promise<PrivacyMapConversionResponse>;
@@ -162,4 +182,3 @@ type DeepPartial<T> = T extends Builtin
162182
: T extends {}
163183
? { [K in keyof T]?: DeepPartial<T[K]> }
164184
: Partial<T>;
165-

lib/types/proto/lit/lit-autopilot.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export interface ListAutopilotFeaturesResponse_FeaturesEntry {
7070
}
7171

7272
export interface RevokeAutopilotSessionRequest {
73+
/**
74+
* The local static public key of the Autopilot session to be revoked.
75+
* When using REST, this field must be encoded as base64url.
76+
*/
7377
localPublicKey: Uint8Array | string;
7478
}
7579

@@ -123,15 +127,35 @@ export interface Permissions {
123127
}
124128

125129
export interface Autopilot {
130+
/**
131+
* litcli: `autopilot features`
132+
* ListAutopilotFeatures fetches all the features supported by the Autopilot
133+
* server along with the rules that we need to support in order to subscribe
134+
* to those features.
135+
*/
126136
listAutopilotFeatures(
127137
request?: DeepPartial<ListAutopilotFeaturesRequest>
128138
): Promise<ListAutopilotFeaturesResponse>;
139+
/**
140+
* litcli: `autopilot add`
141+
* AddAutopilotSession creates a new LNC session and attempts to register it
142+
* with the Autopilot server.
143+
*/
129144
addAutopilotSession(
130145
request?: DeepPartial<AddAutopilotSessionRequest>
131146
): Promise<AddAutopilotSessionResponse>;
147+
/**
148+
* litcli: `autopilot list`
149+
* ListAutopilotSessions lists all the sessions that are of type
150+
* TypeAutopilot.
151+
*/
132152
listAutopilotSessions(
133153
request?: DeepPartial<ListAutopilotSessionsRequest>
134154
): Promise<ListAutopilotSessionsResponse>;
155+
/**
156+
* litcli: `autopilot revoke`
157+
* RevokeAutopilotSession revokes an Autopilot session.
158+
*/
135159
revokeAutopilotSession(
136160
request?: DeepPartial<RevokeAutopilotSessionRequest>
137161
): Promise<RevokeAutopilotSessionResponse>;
@@ -155,4 +179,3 @@ type DeepPartial<T> = T extends Builtin
155179
: T extends {}
156180
? { [K in keyof T]?: DeepPartial<T[K]> }
157181
: Partial<T>;
158-

lib/types/proto/lit/lit-sessions.ts

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,25 @@ export enum SessionState {
1818
}
1919

2020
export interface AddSessionRequest {
21+
/** A user assigned label for the session. */
2122
label: string;
23+
/**
24+
* The session type. This will be used during macaroon construction to
25+
* determine how restrictive to make the macaroon and thus the session access.
26+
*/
2227
sessionType: SessionType;
28+
/** The time at which the session should automatically be revoked. */
2329
expiryTimestampSeconds: string;
30+
/** The address of the mailbox server that the LNC connection should use. */
2431
mailboxServerAddr: string;
32+
/** If set to true, tls will be skipped when connecting to the mailbox. */
2533
devServer: boolean;
34+
/** Any custom permissions to add the session's macaroon. */
2635
macaroonCustomPermissions: MacaroonPermission[];
36+
/**
37+
* The ID of the account to associate this session with. This should only be
38+
* set if the session_type is TYPE_MACAROON_ACCOUNT.
39+
*/
2740
accountId: string;
2841
}
2942

@@ -37,34 +50,74 @@ export interface MacaroonPermission {
3750
/**
3851
* The action that is granted. If entity is set to "uri", then action must
3952
* be set to either:
40-
* - a particular URI to which access should be granted.
41-
* - a URI regex, in which case access will be granted to each URI that
42-
* matches the regex.
43-
* - the "***readonly***" keyword. This will result in the access being
44-
* granted to all read-only endpoints.
53+
* - a particular URI to which access should be granted.
54+
* - a URI regex, in which case access will be granted to each URI that
55+
* matches the regex.
56+
* - the "***readonly***" keyword. This will result in the access being
57+
* granted to all read-only endpoints.
4558
*/
4659
action: string;
4760
}
4861

4962
export interface AddSessionResponse {
63+
/** The session of the newly created session. */
5064
session: Session | undefined;
5165
}
5266

5367
export interface Session {
68+
/**
69+
* A unique ID assigned to the session. It is derived from the session
70+
* macaroon.
71+
*/
5472
id: Uint8Array | string;
73+
/** A user assigned label for the session. */
5574
label: string;
75+
/**
76+
* The current state that the session is in. This will give an indication of
77+
* if the session is currently usable or not.
78+
*/
5679
sessionState: SessionState;
80+
/**
81+
* The session type. The will given an indication of the restrictions applied
82+
* to the macaroon assigned to the session.
83+
*/
5784
sessionType: SessionType;
85+
/** The time at which the session will automatically be revoked. */
5886
expiryTimestampSeconds: string;
87+
/** The address of the mailbox server that the LNC connection should use. */
5988
mailboxServerAddr: string;
89+
/** If set to true, tls will be skipped when connecting to the mailbox. */
6090
devServer: boolean;
91+
/** The LNC pairing phrase in byte form. */
6192
pairingSecret: Uint8Array | string;
93+
/** The LNC pairing phrase in mnemonic form. */
6294
pairingSecretMnemonic: string;
95+
/**
96+
* The long term, local static public key used by this node for the LNC
97+
* connection.
98+
*/
6399
localPublicKey: Uint8Array | string;
100+
/**
101+
* The long term, remote static public key used by the remote party for the
102+
* LNC connection.
103+
*/
64104
remotePublicKey: Uint8Array | string;
105+
/** The time at which the session was created. */
65106
createdAt: string;
107+
/**
108+
* The recipe used for creating a macaroon to use with this session. This will
109+
* be closely linked to the session type.
110+
*/
66111
macaroonRecipe: MacaroonRecipe | undefined;
112+
/**
113+
* If the session is for a specific account, then this will be the account ID
114+
* it is associated with.
115+
*/
67116
accountId: string;
117+
/**
118+
* If this session is for Autopilot use, then this will be the set of features
119+
* that the session can be used for along with the rules for each feature.
120+
*/
68121
autopilotFeatureInfo: { [key: string]: RulesMap };
69122
/**
70123
* The unix timestamp indicating the time at which the session was revoked.
@@ -83,17 +136,24 @@ export interface Session_AutopilotFeatureInfoEntry {
83136
}
84137

85138
export interface MacaroonRecipe {
139+
/** A list of permissions that should be included in the macaroon. */
86140
permissions: MacaroonPermission[];
141+
/** A list of caveats to add to the macaroon. */
87142
caveats: string[];
88143
}
89144

90145
export interface ListSessionsRequest {}
91146

92147
export interface ListSessionsResponse {
148+
/** A list of sessions. */
93149
sessions: Session[];
94150
}
95151

96152
export interface RevokeSessionRequest {
153+
/**
154+
* The local static key of the session to be revoked.
155+
* When using REST, this field must be encoded as base64url.
156+
*/
97157
localPublicKey: Uint8Array | string;
98158
}
99159

@@ -170,22 +230,31 @@ export interface ChannelPolicyBounds {
170230
}
171231

172232
export interface OffChainBudget {
233+
/** The maximum amount that can be spent off-chain excluding fees. */
173234
maxAmtMsat: string;
235+
/** The maximum amount that can be spent off-chain on fees. */
174236
maxFeesMsat: string;
175237
}
176238

177239
export interface OnChainBudget {
240+
/** The maximum amount that can be spent on-chain including fees. */
178241
absoluteAmtSats: string;
242+
/** The maximum amount that can be spent on-chain in fees. */
179243
maxSatPerVByte: string;
180244
}
181245

182246
export interface SendToSelf {}
183247

184248
export interface ChannelRestrict {
249+
/**
250+
* A list of channel IDs that the Autopilot should _not_ perform any actions
251+
* on.
252+
*/
185253
channelIds: string[];
186254
}
187255

188256
export interface PeerRestrict {
257+
/** A list of peer IDs that the Autopilot should _not_ perform any actions on. */
189258
peerIds: string[];
190259
}
191260

@@ -194,8 +263,25 @@ export interface PeerRestrict {
194263
* daemon's session system.
195264
*/
196265
export interface Sessions {
197-
addSession(request?: DeepPartial<AddSessionRequest>): Promise<AddSessionResponse>;
198-
listSessions(request?: DeepPartial<ListSessionsRequest>): Promise<ListSessionsResponse>;
266+
/**
267+
* litcli: `sessions add`
268+
* AddSession adds and starts a new LNC session.
269+
*/
270+
addSession(
271+
request?: DeepPartial<AddSessionRequest>
272+
): Promise<AddSessionResponse>;
273+
/**
274+
* litcli: `sessions list`
275+
* ListSessions returns all sessions known to the session store.
276+
*/
277+
listSessions(
278+
request?: DeepPartial<ListSessionsRequest>
279+
): Promise<ListSessionsResponse>;
280+
/**
281+
* litcli: `sessions revoke`
282+
* RevokeSession revokes a single session and also stops it if it is currently
283+
* active.
284+
*/
199285
revokeSession(
200286
request?: DeepPartial<RevokeSessionRequest>
201287
): Promise<RevokeSessionResponse>;
@@ -219,4 +305,3 @@ type DeepPartial<T> = T extends Builtin
219305
: T extends {}
220306
? { [K in keyof T]?: DeepPartial<T[K]> }
221307
: Partial<T>;
222-

0 commit comments

Comments
 (0)