Skip to content

Commit 79f23c6

Browse files
committed
deps: upgrade loop to v0.31.7-beta
1 parent f1874d7 commit 79f23c6

File tree

6 files changed

+203
-7
lines changed

6 files changed

+203
-7
lines changed

lib/types/proto/loop/client.ts

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ export enum StaticAddressLoopInSwapState {
268268
UNRECOGNIZED = 'UNRECOGNIZED'
269269
}
270270

271+
export interface StopDaemonRequest {}
272+
273+
export interface StopDaemonResponse {}
274+
271275
export interface LoopOutRequest {
272276
/** Requested swap amount in sat. This does not include the swap and miner fee. */
273277
amt: string;
@@ -622,7 +626,12 @@ export interface OutTermsResponse {
622626
}
623627

624628
export interface QuoteRequest {
625-
/** The amount to swap in satoshis. */
629+
/**
630+
* The amount to swap in satoshis. In the loop-in case this can either be taken
631+
* from the connected lnd wallet or coin-selected from static address deposits.
632+
* This is controlled by the select_deposits flag. If deposit_outpoints are
633+
* specified, the coins are taken out of that.
634+
*/
626635
amt: string;
627636
/**
628637
* The confirmation target that should be used either for the sweep of the
@@ -660,15 +669,29 @@ export interface QuoteRequest {
660669
private: boolean;
661670
/**
662671
* Static address deposit outpoints that will be quoted for. This option only
663-
* pertains to loop in swaps. Either this or the amt parameter can be set at
664-
* the same time.
672+
* pertains to loop in swaps. If the amt field is set as well the respective
673+
* partial amount will be swapped. Cannot be used in conjunction with
674+
* auto_select_deposits.
665675
*/
666676
depositOutpoints: string[];
667677
/**
668678
* The optional asset information to use for the swap. If set, the quote will
669679
* be returned in the specified asset.
670680
*/
671681
assetInfo: AssetLoopOutRequest | undefined;
682+
/**
683+
* In the legacy loop-in case this field must be set to false.
684+
* If set to true, the swap amount will be automatically selected from the
685+
* static address deposits. If set to true, deposit_outpoints must be empty.
686+
* This option only pertains to loop in swaps.
687+
*/
688+
autoSelectDeposits: boolean;
689+
/**
690+
* If set to true the server will immediately publish the swap in exchange for
691+
* a higher fee. This can be useful if the client expects change from a swap.
692+
* Note that this feature is only available for static address loop in swaps.
693+
*/
694+
fast: boolean;
672695
}
673696

674697
export interface InQuoteResponse {
@@ -687,6 +710,12 @@ export interface InQuoteResponse {
687710
cltvDelta: number;
688711
/** The confirmation target to be used to publish the on-chain HTLC. */
689712
confTarget: number;
713+
/**
714+
* If the quote request was for a static address loop in and only contained
715+
* deposit outpoints the quote response will return the total amount of the
716+
* selected deposits.
717+
*/
718+
quotedAmt: string;
690719
}
691720

692721
export interface OutQuoteResponse {
@@ -947,6 +976,12 @@ export interface LiquidityParameters {
947976
* not be able to be batched with other swaps.
948977
*/
949978
fastSwapPublication: boolean;
979+
/**
980+
* A list of peers (their public keys) that should be excluded from the easy
981+
* autoloop run. If set, channels connected to these peers won't be
982+
* considered for easy autoloop swaps.
983+
*/
984+
easyAutoloopExcludedPeers: Uint8Array | string[];
950985
}
951986

952987
export interface LiquidityParameters_EasyAssetParamsEntry {
@@ -1282,6 +1317,11 @@ export interface Deposit {
12821317
* loop-in swap anymore.
12831318
*/
12841319
blocksUntilExpiry: string;
1320+
/**
1321+
* The swap hash of the swap that this deposit is part of. This field is only
1322+
* set if the deposit is part of a loop-in swap.
1323+
*/
1324+
swapHash: Uint8Array | string;
12851325
}
12861326

12871327
export interface StaticAddressWithdrawal {
@@ -1320,6 +1360,8 @@ export interface StaticAddressLoopInSwap {
13201360
* fees.
13211361
*/
13221362
paymentRequestAmountSatoshis: string;
1363+
/** The deposits that were used for this swap. */
1364+
deposits: Deposit[];
13231365
}
13241366

13251367
export interface StaticAddressLoopInRequest {
@@ -1366,6 +1408,22 @@ export interface StaticAddressLoopInRequest {
13661408
* side and the client can retry the swap with different parameters.
13671409
*/
13681410
paymentTimeoutSeconds: number;
1411+
/**
1412+
* The optional swap amount the client is attempting to swap. It can be
1413+
* provided in combination with the outpoints or separately. If provided with
1414+
* outpoints the client takes out this amount from the sum of provided
1415+
* outpoints and sends the change back to the static address. If the amount is
1416+
* provided without outpoints, the client will select deposits automatically.
1417+
* The coin selection strategy is simplified by sorting all available deposits
1418+
* in descending order by amount, and equal amounts in ascending order of
1419+
* blocks until expiry, and then selecting the largest deposits first until the
1420+
* amount is reached. The change will be sent back to the static address. If a
1421+
* subset of outpoints suffice to cover the specified amount the swap will be
1422+
* canceled to allow the user to safe on transaction fees.
1423+
*/
1424+
amount: string;
1425+
/** If set, request the server to use fast publication behavior. */
1426+
fast: boolean;
13691427
}
13701428

13711429
export interface StaticAddressLoopInResponse {
@@ -1402,6 +1460,20 @@ export interface StaticAddressLoopInResponse {
14021460
* side and the client can retry the swap with different parameters.
14031461
*/
14041462
paymentTimeoutSeconds: number;
1463+
/** The deposits that are used for this swap. */
1464+
usedDeposits: Deposit[];
1465+
/**
1466+
* The amount that is being swapped (may be less than total deposit value if
1467+
* change is returned).
1468+
*/
1469+
swapAmount: string;
1470+
/** The change amount that will be returned to the static address. */
1471+
change: string;
1472+
/**
1473+
* If set, indicates that the server was requested to use fast publication
1474+
* behavior.
1475+
*/
1476+
fast: boolean;
14051477
}
14061478

14071479
export interface AssetLoopOutRequest {
@@ -1610,6 +1682,13 @@ export interface SwapClient {
16101682
* GetInfo gets basic information about the loop daemon.
16111683
*/
16121684
getInfo(request?: DeepPartial<GetInfoRequest>): Promise<GetInfoResponse>;
1685+
/**
1686+
* loop: `stop`
1687+
* StopDaemon instructs the daemon to shut down gracefully.
1688+
*/
1689+
stopDaemon(
1690+
request?: DeepPartial<StopDaemonRequest>
1691+
): Promise<StopDaemonResponse>;
16131692
/**
16141693
* loop: `getparams`
16151694
* GetLiquidityParams gets the parameters that the daemon's liquidity manager

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "./dist/index.d.ts",
77
"config": {
88
"lnd_release_tag": "v0.19.1-beta",
9-
"loop_release_tag": "v0.31.2-beta",
9+
"loop_release_tag": "v0.31.7-beta",
1010
"pool_release_tag": "v0.6.6-beta",
1111
"faraday_release_tag": "v0.2.16-alpha",
1212
"tapd_release_tag": "v0.6.0",

protos/loop/v0.31.2-beta/client.proto renamed to protos/loop/v0.31.7-beta/client.proto

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ service SwapClient {
100100
*/
101101
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
102102

103+
/* loop: `stop`
104+
StopDaemon instructs the daemon to shut down gracefully.
105+
*/
106+
rpc StopDaemon (StopDaemonRequest) returns (StopDaemonResponse);
107+
103108
/* loop: `getparams`
104109
GetLiquidityParams gets the parameters that the daemon's liquidity manager
105110
is currently configured with. This may be nil if nothing is configured.
@@ -202,6 +207,12 @@ service SwapClient {
202207
returns (StaticAddressLoopInResponse);
203208
}
204209

210+
message StopDaemonRequest {
211+
}
212+
213+
message StopDaemonResponse {
214+
}
215+
205216
message LoopOutRequest {
206217
/*
207218
Requested swap amount in sat. This does not include the swap and miner fee.
@@ -775,7 +786,10 @@ message OutTermsResponse {
775786

776787
message QuoteRequest {
777788
/*
778-
The amount to swap in satoshis.
789+
The amount to swap in satoshis. In the loop-in case this can either be taken
790+
from the connected lnd wallet or coin-selected from static address deposits.
791+
This is controlled by the select_deposits flag. If deposit_outpoints are
792+
specified, the coins are taken out of that.
779793
*/
780794
int64 amt = 1;
781795

@@ -823,8 +837,9 @@ message QuoteRequest {
823837

824838
/*
825839
Static address deposit outpoints that will be quoted for. This option only
826-
pertains to loop in swaps. Either this or the amt parameter can be set at
827-
the same time.
840+
pertains to loop in swaps. If the amt field is set as well the respective
841+
partial amount will be swapped. Cannot be used in conjunction with
842+
auto_select_deposits.
828843
*/
829844
repeated string deposit_outpoints = 8;
830845

@@ -833,6 +848,21 @@ message QuoteRequest {
833848
be returned in the specified asset.
834849
*/
835850
AssetLoopOutRequest asset_info = 9;
851+
852+
/*
853+
In the legacy loop-in case this field must be set to false.
854+
If set to true, the swap amount will be automatically selected from the
855+
static address deposits. If set to true, deposit_outpoints must be empty.
856+
This option only pertains to loop in swaps.
857+
*/
858+
bool auto_select_deposits = 10;
859+
860+
/*
861+
If set to true the server will immediately publish the swap in exchange for
862+
a higher fee. This can be useful if the client expects change from a swap.
863+
Note that this feature is only available for static address loop in swaps.
864+
*/
865+
bool fast = 11;
836866
}
837867

838868
message InQuoteResponse {
@@ -862,6 +892,13 @@ message InQuoteResponse {
862892
The confirmation target to be used to publish the on-chain HTLC.
863893
*/
864894
int32 conf_target = 6;
895+
896+
/*
897+
If the quote request was for a static address loop in and only contained
898+
deposit outpoints the quote response will return the total amount of the
899+
selected deposits.
900+
*/
901+
int64 quoted_amt = 7;
865902
}
866903

867904
message OutQuoteResponse {
@@ -1243,6 +1280,13 @@ message LiquidityParameters {
12431280
* not be able to be batched with other swaps.
12441281
*/
12451282
bool fast_swap_publication = 26;
1283+
1284+
/*
1285+
A list of peers (their public keys) that should be excluded from the easy
1286+
autoloop run. If set, channels connected to these peers won't be
1287+
considered for easy autoloop swaps.
1288+
*/
1289+
repeated bytes easy_autoloop_excluded_peers = 27;
12461290
}
12471291

12481292
message EasyAssetAutoloopParams {
@@ -1910,6 +1954,12 @@ message Deposit {
19101954
loop-in swap anymore.
19111955
*/
19121956
int64 blocks_until_expiry = 6;
1957+
1958+
/*
1959+
The swap hash of the swap that this deposit is part of. This field is only
1960+
set if the deposit is part of a loop-in swap.
1961+
*/
1962+
bytes swap_hash = 7;
19131963
}
19141964

19151965
message StaticAddressWithdrawal {
@@ -1971,6 +2021,11 @@ message StaticAddressLoopInSwap {
19712021
fees.
19722022
*/
19732023
int64 payment_request_amount_satoshis = 5;
2024+
2025+
/*
2026+
The deposits that were used for this swap.
2027+
*/
2028+
repeated Deposit deposits = 6;
19742029
}
19752030

19762031
enum StaticAddressLoopInSwapState {
@@ -2078,6 +2133,24 @@ message StaticAddressLoopInRequest {
20782133
side and the client can retry the swap with different parameters.
20792134
*/
20802135
uint32 payment_timeout_seconds = 8;
2136+
2137+
/*
2138+
The optional swap amount the client is attempting to swap. It can be
2139+
provided in combination with the outpoints or separately. If provided with
2140+
outpoints the client takes out this amount from the sum of provided
2141+
outpoints and sends the change back to the static address. If the amount is
2142+
provided without outpoints, the client will select deposits automatically.
2143+
The coin selection strategy is simplified by sorting all available deposits
2144+
in descending order by amount, and equal amounts in ascending order of
2145+
blocks until expiry, and then selecting the largest deposits first until the
2146+
amount is reached. The change will be sent back to the static address. If a
2147+
subset of outpoints suffice to cover the specified amount the swap will be
2148+
canceled to allow the user to safe on transaction fees.
2149+
*/
2150+
int64 amount = 9;
2151+
2152+
// If set, request the server to use fast publication behavior.
2153+
bool fast = 10;
20812154
}
20822155

20832156
message StaticAddressLoopInResponse {
@@ -2142,6 +2215,28 @@ message StaticAddressLoopInResponse {
21422215
side and the client can retry the swap with different parameters.
21432216
*/
21442217
uint32 payment_timeout_seconds = 11;
2218+
2219+
/*
2220+
The deposits that are used for this swap.
2221+
*/
2222+
repeated Deposit used_deposits = 12;
2223+
2224+
/*
2225+
The amount that is being swapped (may be less than total deposit value if
2226+
change is returned).
2227+
*/
2228+
uint64 swap_amount = 13;
2229+
2230+
/*
2231+
The change amount that will be returned to the static address.
2232+
*/
2233+
int64 change = 14;
2234+
2235+
/*
2236+
If set, indicates that the server was requested to use fast publication
2237+
behavior.
2238+
*/
2239+
bool fast = 15;
21452240
}
21462241

21472242
message AssetLoopOutRequest {
File renamed without changes.

protos/loop/v0.31.2-beta/swapserverrpc/server.proto renamed to protos/loop/v0.31.7-beta/swapserverrpc/server.proto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ message ServerLoopInQuoteRequest {
294294
// service fee. This is to cover for the increased on-chain fee the server
295295
// has to pay when the sweeping transaction is broadcast.
296296
uint32 num_static_address_deposits = 7;
297+
298+
// If set, request the server to use fast publication behavior. Note that
299+
// this falg is only available for static address loop ins.
300+
bool fast = 8;
297301
}
298302

299303
message ServerLoopInQuoteResponse {
@@ -660,6 +664,12 @@ message FetchL402Response {
660664

661665
// SubscribeNotificationsRequest is a request to subscribe to notifications.
662666
message SubscribeNotificationsRequest {
667+
enum ListenerVersion {
668+
LEGACY = 0;
669+
V1 = 1;
670+
}
671+
672+
ListenerVersion version = 1;
663673
}
664674

665675
// SubscribeNotificationsResponse is a response to a
@@ -668,6 +678,7 @@ message SubscribeNotificationsResponse {
668678
oneof notification {
669679
ServerReservationNotification reservation_notification = 1;
670680
ServerStaticLoopInSweepNotification static_loop_in_sweep = 2;
681+
ServerUnfinishedSwapNotification unfinished_swap = 3;
671682
}
672683
}
673684

@@ -687,3 +698,14 @@ message ServerStaticLoopInSweepNotification {
687698
// The prevout information of the sweep txn.
688699
repeated PrevoutInfo prevout_info = 4;
689700
}
701+
702+
// ServerUnfinishedSwapNotification notifies the client about an unfinished
703+
// swap that needs attention. This is useful in client data loss scenarios to
704+
// help the client recover the swap.
705+
message ServerUnfinishedSwapNotification {
706+
// The swap hash of the unfinished swap.
707+
bytes swap_hash = 1;
708+
709+
// Whether the swap is a loop in or loop out.
710+
bool is_loop_in = 2;
711+
}

0 commit comments

Comments
 (0)