2019-03-06 21:13:50 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
2021-12-13 13:56:40 +02:00
|
|
|
import "swapserverrpc/common.proto";
|
2025-05-21 14:08:54 +02:00
|
|
|
import "lnrpc/lightning.proto";
|
2021-05-10 16:55:53 +02:00
|
|
|
|
2019-03-06 15:53:17 -08:00
|
|
|
package looprpc;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2021-05-25 16:33:44 +02:00
|
|
|
option go_package = "github.com/lightninglabs/loop/looprpc";
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 18:24:29 -08:00
|
|
|
SwapClient is a service that handles the client side process of onchain/offchain
|
|
|
|
|
swaps. The service is designed for a single client.
|
|
|
|
|
*/
|
|
|
|
|
service SwapClient {
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `out`
|
2019-03-06 18:24:29 -08:00
|
|
|
LoopOut initiates an loop out swap with the given parameters. The call
|
|
|
|
|
returns after the swap has been set up with the swap server. From that
|
|
|
|
|
point onwards, progress can be tracked via the SwapStatus stream that is
|
|
|
|
|
returned from Monitor().
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc LoopOut (LoopOutRequest) returns (SwapResponse);
|
2019-03-12 15:34:45 -07:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `in`
|
2019-03-12 16:10:37 +01:00
|
|
|
LoopIn initiates a loop in swap with the given parameters. The call
|
|
|
|
|
returns after the swap has been set up with the swap server. From that
|
|
|
|
|
point onwards, progress can be tracked via the SwapStatus stream
|
|
|
|
|
that is returned from Monitor().
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc LoopIn (LoopInRequest) returns (SwapResponse);
|
2019-03-12 16:10:37 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `monitor`
|
2019-03-06 18:24:29 -08:00
|
|
|
Monitor will return a stream of swap updates for currently active swaps.
|
|
|
|
|
*/
|
2020-02-14 09:14:12 +01:00
|
|
|
rpc Monitor (MonitorRequest) returns (stream SwapStatus);
|
2020-01-31 13:57:22 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `listswaps`
|
2020-01-31 13:57:22 +01:00
|
|
|
ListSwaps returns a list of all currently known swaps and their current
|
|
|
|
|
status.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc ListSwaps (ListSwapsRequest) returns (ListSwapsResponse);
|
2020-01-31 13:57:22 +01:00
|
|
|
|
2026-01-14 18:08:48 -05:00
|
|
|
/* loop: `sweephtlc`
|
|
|
|
|
SweepHtlc spends a swap HTLC output via the preimage (success) path using
|
|
|
|
|
the swap's known preimage or an optionally supplied one.
|
|
|
|
|
*/
|
|
|
|
|
rpc SweepHtlc (SweepHtlcRequest) returns (SweepHtlcResponse);
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `swapinfo`
|
2020-01-31 13:57:22 +01:00
|
|
|
SwapInfo returns all known details about a single swap.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc SwapInfo (SwapInfoRequest) returns (SwapStatus);
|
2019-03-06 18:24:29 -08:00
|
|
|
|
2023-11-13 14:47:46 +01:00
|
|
|
/* loop: `abandonswap`
|
|
|
|
|
AbandonSwap allows the client to abandon a swap.
|
|
|
|
|
*/
|
|
|
|
|
rpc AbandonSwap (AbandonSwapRequest) returns (AbandonSwapResponse);
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `terms`
|
2019-03-12 15:34:45 -07:00
|
|
|
LoopOutTerms returns the terms that the server enforces for a loop out swap.
|
2019-03-06 18:24:29 -08:00
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc LoopOutTerms (TermsRequest) returns (OutTermsResponse);
|
2019-03-06 18:24:29 -08:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `quote`
|
2019-03-12 15:34:45 -07:00
|
|
|
LoopOutQuote returns a quote for a loop out swap with the provided
|
|
|
|
|
parameters.
|
2019-03-06 18:24:29 -08:00
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc LoopOutQuote (QuoteRequest) returns (OutQuoteResponse);
|
2019-03-12 16:10:37 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `terms`
|
2019-03-12 16:10:37 +01:00
|
|
|
GetTerms returns the terms that the server enforces for swaps.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc GetLoopInTerms (TermsRequest) returns (InTermsResponse);
|
2019-03-12 16:10:37 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `quote`
|
2019-03-12 16:10:37 +01:00
|
|
|
GetQuote returns a quote for a swap with the provided parameters.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc GetLoopInQuote (QuoteRequest) returns (InQuoteResponse);
|
2019-11-15 13:57:03 +01:00
|
|
|
|
2021-05-10 16:55:53 +02:00
|
|
|
/*
|
|
|
|
|
Probe asks he sever to probe the route to us to have a better upfront
|
|
|
|
|
estimate about routing fees when loopin-in.
|
|
|
|
|
*/
|
|
|
|
|
rpc Probe (ProbeRequest) returns (ProbeResponse);
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/* loop: `listauth`
|
2024-04-17 15:57:59 -03:00
|
|
|
GetL402Tokens returns all L402 tokens the daemon ever paid for.
|
2019-11-15 13:57:03 +01:00
|
|
|
*/
|
2024-04-17 15:57:59 -03:00
|
|
|
rpc GetL402Tokens (TokensRequest) returns (TokensResponse);
|
2020-09-01 09:58:09 +02:00
|
|
|
|
2024-04-25 12:04:03 -03:00
|
|
|
/*
|
|
|
|
|
Deprecated: use GetL402Tokens.
|
|
|
|
|
This API is provided to maintain backward compatibility with gRPC clients
|
|
|
|
|
(e.g. `loop listauth`, Terminal Web, RTL).
|
|
|
|
|
Type LsatToken used by GetLsatTokens in the past was renamed to L402Token,
|
|
|
|
|
but this does not affect binary encoding, so we can use type L402Token here.
|
|
|
|
|
*/
|
|
|
|
|
rpc GetLsatTokens (TokensRequest) returns (TokensResponse);
|
|
|
|
|
|
2024-10-30 14:21:36 +01:00
|
|
|
/* 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);
|
|
|
|
|
|
2023-05-24 12:39:47 +02:00
|
|
|
/* loop: `getinfo`
|
|
|
|
|
GetInfo gets basic information about the loop daemon.
|
|
|
|
|
*/
|
|
|
|
|
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
|
|
|
|
|
|
2025-11-19 20:07:01 -03:00
|
|
|
/* loop: `stop`
|
|
|
|
|
StopDaemon instructs the daemon to shut down gracefully.
|
|
|
|
|
*/
|
|
|
|
|
rpc StopDaemon (StopDaemonRequest) returns (StopDaemonResponse);
|
|
|
|
|
|
2021-07-14 16:08:53 +02:00
|
|
|
/* loop: `getparams`
|
2020-09-01 09:58:09 +02:00
|
|
|
GetLiquidityParams gets the parameters that the daemon's liquidity manager
|
|
|
|
|
is currently configured with. This may be nil if nothing is configured.
|
|
|
|
|
[EXPERIMENTAL]: endpoint is subject to change.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc GetLiquidityParams (GetLiquidityParamsRequest)
|
|
|
|
|
returns (LiquidityParameters);
|
2020-09-01 09:58:09 +02:00
|
|
|
|
2021-07-14 16:08:53 +02:00
|
|
|
/* loop: `setparams`
|
2020-09-01 09:58:09 +02:00
|
|
|
SetLiquidityParams sets a new set of parameters for the daemon's liquidity
|
|
|
|
|
manager. Note that the full set of parameters must be provided, because
|
|
|
|
|
this call fully overwrites our existing parameters.
|
|
|
|
|
[EXPERIMENTAL]: endpoint is subject to change.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc SetLiquidityParams (SetLiquidityParamsRequest)
|
|
|
|
|
returns (SetLiquidityParamsResponse);
|
2020-09-03 10:36:44 +02:00
|
|
|
|
2021-07-14 16:08:53 +02:00
|
|
|
/* loop: `suggestswaps`
|
2020-09-03 10:36:44 +02:00
|
|
|
SuggestSwaps returns a list of recommended swaps based on the current
|
|
|
|
|
state of your node's channels and it's liquidity manager parameters.
|
|
|
|
|
Note that only loop out suggestions are currently supported.
|
|
|
|
|
[EXPERIMENTAL]: endpoint is subject to change.
|
|
|
|
|
*/
|
2021-05-25 16:57:36 +02:00
|
|
|
rpc SuggestSwaps (SuggestSwapsRequest) returns (SuggestSwapsResponse);
|
2023-08-25 01:42:35 +02:00
|
|
|
|
|
|
|
|
/* loop: `listreservations`
|
|
|
|
|
ListReservations returns a list of all reservations the server opened to us.
|
|
|
|
|
*/
|
|
|
|
|
rpc ListReservations (ListReservationsRequest)
|
|
|
|
|
returns (ListReservationsResponse);
|
2023-10-25 23:32:06 +02:00
|
|
|
|
|
|
|
|
/* loop: `instantout`
|
|
|
|
|
InstantOut initiates an instant out swap with the given parameters.
|
|
|
|
|
*/
|
|
|
|
|
rpc InstantOut (InstantOutRequest) returns (InstantOutResponse);
|
2024-02-06 19:15:27 +01:00
|
|
|
|
|
|
|
|
/* loop: `instantoutquote`
|
|
|
|
|
InstantOutQuote returns a quote for an instant out swap with the provided
|
|
|
|
|
parameters.
|
|
|
|
|
*/
|
|
|
|
|
rpc InstantOutQuote (InstantOutQuoteRequest)
|
|
|
|
|
returns (InstantOutQuoteResponse);
|
2024-03-01 14:34:53 +01:00
|
|
|
|
|
|
|
|
/* loop: `listinstantouts`
|
|
|
|
|
ListInstantOuts returns a list of all currently known instant out swaps and
|
|
|
|
|
their current status.
|
|
|
|
|
*/
|
|
|
|
|
rpc ListInstantOuts (ListInstantOutsRequest)
|
|
|
|
|
returns (ListInstantOutsResponse);
|
2024-02-26 09:06:06 +01:00
|
|
|
|
|
|
|
|
/* 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);
|
2024-05-06 14:13:15 +02:00
|
|
|
|
|
|
|
|
/* loop:`static withdraw`
|
|
|
|
|
WithdrawDeposits withdraws a selection or all deposits of a static address.
|
|
|
|
|
*/
|
|
|
|
|
rpc WithdrawDeposits (WithdrawDepositsRequest)
|
|
|
|
|
returns (WithdrawDepositsResponse);
|
2024-06-05 13:33:47 +02:00
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
/* loop:`listdeposits`
|
|
|
|
|
ListStaticAddressDeposits returns a list of filtered static address
|
|
|
|
|
deposits.
|
|
|
|
|
*/
|
|
|
|
|
rpc ListStaticAddressDeposits (ListStaticAddressDepositsRequest)
|
|
|
|
|
returns (ListStaticAddressDepositsResponse);
|
|
|
|
|
|
2025-05-13 11:34:02 +02:00
|
|
|
/* loop:`listwithdrawals`
|
|
|
|
|
ListStaticAddressWithdrawals returns a list of static address withdrawals.
|
|
|
|
|
*/
|
|
|
|
|
rpc ListStaticAddressWithdrawals (ListStaticAddressWithdrawalRequest)
|
|
|
|
|
returns (ListStaticAddressWithdrawalResponse);
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
/* loop:`listswaps`
|
|
|
|
|
ListStaticAddressSwaps returns a list of filtered static address
|
|
|
|
|
swaps.
|
|
|
|
|
*/
|
|
|
|
|
rpc ListStaticAddressSwaps (ListStaticAddressSwapsRequest)
|
|
|
|
|
returns (ListStaticAddressSwapsResponse);
|
|
|
|
|
|
2024-06-05 13:33:47 +02:00
|
|
|
/* loop:`static summary`
|
|
|
|
|
GetStaticAddressSummary returns a summary of static address related
|
|
|
|
|
statistics.
|
|
|
|
|
*/
|
|
|
|
|
rpc GetStaticAddressSummary (StaticAddressSummaryRequest)
|
|
|
|
|
returns (StaticAddressSummaryResponse);
|
2024-11-19 13:15:53 +01:00
|
|
|
|
2025-05-21 14:08:54 +02:00
|
|
|
/* loop:`static in`
|
2024-11-19 13:15:53 +01:00
|
|
|
StaticAddressLoopIn initiates a static address loop-in swap.
|
|
|
|
|
*/
|
|
|
|
|
rpc StaticAddressLoopIn (StaticAddressLoopInRequest)
|
|
|
|
|
returns (StaticAddressLoopInResponse);
|
2025-05-21 14:08:54 +02:00
|
|
|
|
|
|
|
|
/* loop:`static openchannel`
|
|
|
|
|
StaticOpenChannel opens a channel funded by selected static address
|
|
|
|
|
deposits.
|
|
|
|
|
*/
|
|
|
|
|
rpc StaticOpenChannel (StaticOpenChannelRequest)
|
|
|
|
|
returns (StaticOpenChannelResponse);
|
2019-03-06 18:24:29 -08:00
|
|
|
}
|
|
|
|
|
|
2025-05-21 14:08:54 +02:00
|
|
|
message StaticOpenChannelRequest {
|
|
|
|
|
// Wrap lnd's request so Loop can extend this RPC with Loop-specific fields
|
|
|
|
|
// without diverging from the upstream API surface.
|
|
|
|
|
lnrpc.OpenChannelRequest open_channel_request = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message StaticOpenChannelResponse {
|
|
|
|
|
/*
|
|
|
|
|
The outpoint of the channel opening transaction in the format
|
|
|
|
|
"txid:output_index".
|
|
|
|
|
*/
|
|
|
|
|
string channel_open_outpoint = 1;
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-19 20:07:01 -03:00
|
|
|
message StopDaemonRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message StopDaemonResponse {
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-06 18:24:29 -08:00
|
|
|
message LoopOutRequest {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 18:24:29 -08:00
|
|
|
Requested swap amount in sat. This does not include the swap and miner fee.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Base58 encoded destination address for the swap.
|
|
|
|
|
*/
|
|
|
|
|
string dest = 2;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Maximum off-chain fee in sat that may be paid for swap payment to the
|
|
|
|
|
server. This limit is applied during path finding. Typically this value is
|
|
|
|
|
taken from the response of the GetQuote call.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2019-03-06 18:24:29 -08:00
|
|
|
int64 max_swap_routing_fee = 3;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-06-15 11:30:12 +02:00
|
|
|
Maximum off-chain fee in sat that may be paid for the prepay to the server.
|
2019-03-06 18:24:29 -08:00
|
|
|
This limit is applied during path finding. Typically this value is taken
|
|
|
|
|
from the response of the GetQuote call.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2019-03-06 18:24:29 -08:00
|
|
|
int64 max_prepay_routing_fee = 4;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 18:24:29 -08:00
|
|
|
Maximum 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. It includes the prepay amount.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2019-03-06 18:24:29 -08:00
|
|
|
int64 max_swap_fee = 5;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 18:24:29 -08:00
|
|
|
Maximum amount of the swap fee that may be charged as a prepayment.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2019-03-06 18:24:29 -08:00
|
|
|
int64 max_prepay_amt = 6;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-17 16:10:29 +02:00
|
|
|
Maximum in on-chain fees that we are willing to spend. If we want to
|
2019-03-06 18:24:29 -08:00
|
|
|
sweep the on-chain htlc and the fee estimate turns out higher than this
|
|
|
|
|
value, we cancel the swap. If the fee estimate is lower, we publish the
|
|
|
|
|
sweep tx.
|
2019-03-12 15:34:45 -07:00
|
|
|
|
2019-03-06 18:24:29 -08:00
|
|
|
If the sweep tx is not confirmed, we are forced to ratchet up fees until it
|
|
|
|
|
is swept. Possibly even exceeding max_miner_fee if we get close to the htlc
|
|
|
|
|
timeout. Because the initial publication revealed the preimage, we have no
|
|
|
|
|
other choice. The server may already have pulled the off-chain htlc. Only
|
|
|
|
|
when the fee becomes higher than the swap amount, we can only wait for fees
|
|
|
|
|
to come down and hope - if we are past the timeout - that the server is not
|
|
|
|
|
publishing the revocation.
|
2019-03-12 15:34:45 -07:00
|
|
|
|
2019-03-06 18:24:29 -08:00
|
|
|
max_miner_fee is typically taken from the response of the GetQuote call.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
|
|
|
|
int64 max_miner_fee = 7;
|
2019-03-12 15:34:45 -07:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-05-19 10:21:13 +02:00
|
|
|
Deprecated, use outgoing_chan_set. The channel to loop out, the channel
|
|
|
|
|
to loop out is selected based on the lowest routing fee for the swap
|
|
|
|
|
payment to the server.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2020-05-19 10:21:13 +02:00
|
|
|
uint64 loop_out_channel = 8 [deprecated = true];
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-05-19 10:21:13 +02:00
|
|
|
A restriction on the channel set that may be used to loop out. The actual
|
|
|
|
|
channel(s) that will be used are selected based on the lowest routing fee
|
|
|
|
|
for the swap payment to the server.
|
|
|
|
|
*/
|
|
|
|
|
repeated uint64 outgoing_chan_set = 11;
|
2019-06-25 14:41:49 -04:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-06-25 14:41:49 -04:00
|
|
|
The number of blocks from the on-chain HTLC's confirmation height that it
|
|
|
|
|
should be swept within.
|
|
|
|
|
*/
|
|
|
|
|
int32 sweep_conf_target = 9;
|
2019-11-14 10:35:32 +01:00
|
|
|
|
2020-08-04 16:37:24 +02:00
|
|
|
/*
|
|
|
|
|
The number of confirmations that we require for the on chain htlc that will
|
|
|
|
|
be published by the server before we reveal the preimage.
|
|
|
|
|
*/
|
|
|
|
|
int32 htlc_confirmations = 13;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-14 10:35:32 +01:00
|
|
|
The latest time (in unix seconds) we allow the server to wait before
|
|
|
|
|
publishing the HTLC on chain. Setting this to a larger value will give the
|
|
|
|
|
server the opportunity to batch multiple swaps together, and wait for
|
|
|
|
|
low-fee periods before publishing the HTLC, potentially resulting in a
|
|
|
|
|
lower total swap fee.
|
|
|
|
|
*/
|
|
|
|
|
uint64 swap_publication_deadline = 10;
|
2020-07-28 11:21:28 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An optional label for this swap. This field is limited to 500 characters
|
|
|
|
|
and may not start with the prefix [reserved], which is used to tag labels
|
|
|
|
|
produced by the daemon.
|
|
|
|
|
*/
|
|
|
|
|
string label = 12;
|
2020-11-06 10:43:00 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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 = 14;
|
2023-07-04 18:45:18 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An alternative destination address source for the swap. This field
|
|
|
|
|
represents the name of the account in the backing lnd instance.
|
|
|
|
|
Refer to lnd's wallet import functions for reference.
|
|
|
|
|
*/
|
|
|
|
|
string account = 15;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The address type of the account specified in the account field.
|
|
|
|
|
*/
|
|
|
|
|
AddressType account_addr_type = 16;
|
2023-09-15 19:50:30 +03:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
A flag indicating whether the defined destination address does not belong to
|
|
|
|
|
the wallet. This is used to flag whether this loop out swap could have its
|
|
|
|
|
associated sweep batched.
|
|
|
|
|
*/
|
|
|
|
|
bool is_external_addr = 17;
|
2023-10-25 23:32:06 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The reservations to use for the swap. If this field is set, loop will try
|
|
|
|
|
to use the instant out flow using the given reservations. If the
|
|
|
|
|
reservations are not sufficient, the swap will fail. The swap amount must
|
|
|
|
|
be equal to the sum of the amounts of the reservations.
|
|
|
|
|
*/
|
|
|
|
|
repeated bytes reservation_ids = 18;
|
2024-05-09 15:31:24 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The timeout in seconds to use for off-chain payments. Note that the swap
|
|
|
|
|
payment is attempted multiple times where each attempt will set this value
|
|
|
|
|
as the timeout for the payment.
|
|
|
|
|
*/
|
|
|
|
|
uint32 payment_timeout = 19;
|
2025-01-09 16:22:28 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The optional asset information to use for the swap. If set, the swap will
|
|
|
|
|
be paid in the specified asset using the provided edge node. An Asset client
|
|
|
|
|
must be connected to the loop client to use this feature.
|
|
|
|
|
*/
|
|
|
|
|
AssetLoopOutRequest asset_info = 20;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The optional RFQ information to use for the swap. If set, the swap will
|
|
|
|
|
use the provided RFQs to pay for the swap invoice.
|
|
|
|
|
*/
|
|
|
|
|
AssetRfqInfo asset_rfq_info = 21;
|
2023-07-04 18:45:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
`AddressType` has to be one of:
|
|
|
|
|
|
|
|
|
|
- `unknown`: Unknown address type
|
|
|
|
|
- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 1)
|
|
|
|
|
*/
|
|
|
|
|
enum AddressType {
|
|
|
|
|
ADDRESS_TYPE_UNKNOWN = 0;
|
|
|
|
|
TAPROOT_PUBKEY = 1;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-12 16:10:37 +01:00
|
|
|
message LoopInRequest {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Requested swap amount in sat. This does not include the swap and miner
|
2019-03-12 16:10:37 +01:00
|
|
|
fee.
|
|
|
|
|
*/
|
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-12 16:10:37 +01:00
|
|
|
Maximum 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 = 2;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-17 16:10:29 +02:00
|
|
|
Maximum in on-chain fees that we are willing to spend. If we want to
|
2019-03-12 16:10:37 +01:00
|
|
|
publish the on-chain htlc and the fee estimate turns out higher than this
|
2021-05-25 16:33:44 +02:00
|
|
|
value, we cancel the swap.
|
2019-03-12 16:10:37 +01:00
|
|
|
|
|
|
|
|
max_miner_fee is typically taken from the response of the GetQuote call.
|
|
|
|
|
*/
|
|
|
|
|
int64 max_miner_fee = 3;
|
2019-11-15 13:57:03 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-02-11 13:25:03 +01:00
|
|
|
The last hop to use for the loop in swap. If empty, the last hop is selected
|
|
|
|
|
based on the lowest routing fee for the swap payment from the server.
|
2019-03-12 16:10:37 +01:00
|
|
|
*/
|
2020-02-11 13:25:03 +01:00
|
|
|
bytes last_hop = 4;
|
2019-03-28 13:29:21 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-28 13:29:21 +01:00
|
|
|
If external_htlc is true, we expect the htlc to be published by an external
|
|
|
|
|
actor.
|
|
|
|
|
*/
|
|
|
|
|
bool external_htlc = 5;
|
2020-04-15 09:10:21 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-04-15 09:10:21 +02:00
|
|
|
The number of blocks that the on chain htlc should confirm within.
|
|
|
|
|
*/
|
|
|
|
|
int32 htlc_conf_target = 6;
|
2020-07-28 11:21:28 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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 = 7;
|
2020-11-06 10:43:00 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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 = 8;
|
2021-10-19 18:05:59 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Optional route hints to reach the destination through private channels.
|
|
|
|
|
*/
|
2021-12-13 13:56:40 +02:00
|
|
|
repeated looprpc.RouteHint route_hints = 9;
|
2021-10-19 18:05:59 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Private indicates whether the destination node should be considered
|
|
|
|
|
private. In which case, loop will generate hophints to assist with
|
|
|
|
|
probing and payment.
|
|
|
|
|
*/
|
|
|
|
|
bool private = 10;
|
2019-03-12 16:10:37 +01:00
|
|
|
}
|
2019-03-06 21:13:50 +01:00
|
|
|
|
|
|
|
|
message SwapResponse {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Swap identifier to track status in the update stream that is returned from
|
|
|
|
|
the Start() call. Currently this is the hash that locks the htlcs.
|
2020-01-31 13:57:28 +01:00
|
|
|
DEPRECATED: To make the API more consistent, this field is deprecated in
|
|
|
|
|
favor of id_bytes and will be removed in a future release.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2020-01-31 13:57:28 +01:00
|
|
|
string id = 1 [deprecated = true];
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-01-31 13:57:28 +01:00
|
|
|
Swap identifier to track status in the update stream that is returned from
|
|
|
|
|
the Start() call. Currently this is the hash that locks the htlcs.
|
|
|
|
|
*/
|
|
|
|
|
bytes id_bytes = 3;
|
2019-03-28 13:29:21 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-04-24 17:35:32 +02:00
|
|
|
DEPRECATED. This field stores the address of the onchain htlc, but
|
|
|
|
|
depending on the request, the semantics are different.
|
|
|
|
|
- For internal loop-in htlc_address contains the address of the
|
|
|
|
|
native segwit (P2WSH) htlc.
|
2022-11-04 16:06:22 +01:00
|
|
|
/ - For loop-out htlc_address always contains the native segwit (P2WSH)
|
2020-04-24 17:35:32 +02:00
|
|
|
htlc address.
|
2019-03-28 13:29:21 +01:00
|
|
|
*/
|
2020-04-24 17:35:32 +02:00
|
|
|
string htlc_address = 2 [deprecated = true];
|
|
|
|
|
|
2022-11-04 16:06:22 +01:00
|
|
|
reserved 4;
|
2020-04-24 17:35:32 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-04-24 17:35:32 +02:00
|
|
|
The native segwit address of the on-chain htlc.
|
|
|
|
|
Used for both loop-in and loop-out.
|
|
|
|
|
*/
|
|
|
|
|
string htlc_address_p2wsh = 5;
|
2020-06-30 14:10:33 +02:00
|
|
|
|
2022-04-24 22:59:41 +02:00
|
|
|
// The address of the v3 (taproot) htlc. Used for both loop-in and loop-out.
|
|
|
|
|
string htlc_address_p2tr = 7;
|
|
|
|
|
|
2020-06-30 14:10:33 +02:00
|
|
|
// A human-readable message received from the loop server.
|
|
|
|
|
string server_message = 6;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
2019-11-15 13:57:03 +01:00
|
|
|
message MonitorRequest {
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message SwapStatus {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-12 15:34:45 -07:00
|
|
|
Requested swap amount in sat. This does not include the swap and miner
|
2019-03-06 21:13:50 +01:00
|
|
|
fee.
|
|
|
|
|
*/
|
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-01-31 13:57:28 +01:00
|
|
|
Swap identifier to track status in the update stream that is returned from
|
|
|
|
|
the Start() call. Currently this is the hash that locks the htlcs.
|
|
|
|
|
DEPRECATED: To make the API more consistent, this field is deprecated in
|
|
|
|
|
favor of id_bytes and will be removed in a future release.
|
|
|
|
|
*/
|
|
|
|
|
string id = 2 [deprecated = true];
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Swap identifier to track status in the update stream that is returned from
|
|
|
|
|
the Start() call. Currently this is the hash that locks the htlcs.
|
|
|
|
|
*/
|
2020-01-31 13:57:28 +01:00
|
|
|
bytes id_bytes = 11;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
|
|
|
|
The type of the swap.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
|
|
|
|
SwapType type = 3;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2026-07-08 23:35:19 -03:00
|
|
|
Generic loop-in/loop-out state for swaps.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
|
|
|
|
SwapState state = 4;
|
|
|
|
|
|
2026-07-08 23:35:19 -03:00
|
|
|
oneof static_loop_in_state_optional {
|
|
|
|
|
/*
|
|
|
|
|
Static address loop-in FSM state when type is STATIC_LOOP_IN.
|
|
|
|
|
*/
|
|
|
|
|
StaticAddressLoopInSwapState static_loop_in_state = 20;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-30 09:09:27 +02:00
|
|
|
/*
|
|
|
|
|
A failure reason for the swap, only set if the swap has failed.
|
|
|
|
|
*/
|
|
|
|
|
FailureReason failure_reason = 14;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Initiation time of the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 initiation_time = 5;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Initiation time of the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 last_update_time = 6;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-04-24 17:35:32 +02:00
|
|
|
DEPRECATED: This field stores the address of the onchain htlc.
|
|
|
|
|
- For internal loop-in htlc_address contains the address of the
|
|
|
|
|
native segwit (P2WSH) htlc.
|
|
|
|
|
- For loop-out htlc_address always contains the native segwit (P2WSH)
|
|
|
|
|
htlc address.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2020-04-24 17:35:32 +02:00
|
|
|
string htlc_address = 7 [deprecated = true];
|
|
|
|
|
|
|
|
|
|
// HTLC address (native segwit), used in loop-in and loop-out swaps.
|
|
|
|
|
string htlc_address_p2wsh = 12;
|
|
|
|
|
|
2022-04-24 22:59:41 +02:00
|
|
|
// The address of the v3 (taproot) htlc. Used for both loop-in and loop-out.
|
|
|
|
|
string htlc_address_p2tr = 18;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
// Swap server cost
|
2019-05-15 14:02:29 +02:00
|
|
|
int64 cost_server = 8;
|
|
|
|
|
|
|
|
|
|
// On-chain transaction cost
|
|
|
|
|
int64 cost_onchain = 9;
|
|
|
|
|
|
|
|
|
|
// Off-chain routing fees
|
|
|
|
|
int64 cost_offchain = 10;
|
2020-07-28 11:21:28 +02:00
|
|
|
|
2022-05-30 18:01:17 +02:00
|
|
|
// Optional last hop if provided in the loop in request.
|
|
|
|
|
bytes last_hop = 16;
|
|
|
|
|
|
|
|
|
|
// Optional outgoing channel set if provided in the loop out request.
|
|
|
|
|
repeated uint64 outgoing_chan_set = 17;
|
|
|
|
|
|
2020-07-28 11:21:28 +02:00
|
|
|
// An optional label given to the swap on creation.
|
|
|
|
|
string label = 15;
|
2025-01-20 09:16:07 +01:00
|
|
|
|
|
|
|
|
// If the swap was an asset swap, the asset information will be returned.
|
|
|
|
|
AssetLoopOutInfo asset_info = 19;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-12 15:34:45 -07:00
|
|
|
enum SwapType {
|
2019-03-06 18:24:29 -08:00
|
|
|
// LOOP_OUT indicates an loop out swap (off-chain to on-chain)
|
|
|
|
|
LOOP_OUT = 0;
|
2019-03-12 16:10:37 +01:00
|
|
|
|
|
|
|
|
// LOOP_IN indicates a loop in swap (on-chain to off-chain)
|
|
|
|
|
LOOP_IN = 1;
|
2026-07-08 23:35:19 -03:00
|
|
|
|
|
|
|
|
// STATIC_LOOP_IN indicates a static address loop in swap.
|
|
|
|
|
STATIC_LOOP_IN = 2;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum SwapState {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
INITIATED is the initial state of a swap. At that point, the initiation
|
|
|
|
|
call to the server has been made and the payment process has been started
|
|
|
|
|
for the swap and prepayment invoices.
|
|
|
|
|
*/
|
|
|
|
|
INITIATED = 0;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
PREIMAGE_REVEALED is reached when the sweep tx publication is first
|
|
|
|
|
attempted. From that point on, we should consider the preimage to no
|
|
|
|
|
longer be secret and we need to do all we can to get the sweep confirmed.
|
|
|
|
|
This state will mostly coalesce with StateHtlcConfirmed, except in the
|
|
|
|
|
case where we wait for fees to come down before we sweep.
|
|
|
|
|
*/
|
|
|
|
|
PREIMAGE_REVEALED = 1;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-12 16:10:37 +01:00
|
|
|
HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in
|
|
|
|
|
swap.
|
|
|
|
|
*/
|
|
|
|
|
HTLC_PUBLISHED = 2;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
SUCCESS is the final swap state that is reached when the sweep tx has
|
|
|
|
|
the required confirmation depth.
|
|
|
|
|
*/
|
|
|
|
|
SUCCESS = 3;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
FAILED is the final swap state for a failed swap with or without loss of
|
|
|
|
|
the swap amount.
|
|
|
|
|
*/
|
|
|
|
|
FAILED = 4;
|
2019-04-02 10:51:51 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-30 09:09:27 +02:00
|
|
|
INVOICE_SETTLED is reached when the swap invoice in a loop in swap has been
|
|
|
|
|
paid, but we are still waiting for the htlc spend to confirm.
|
|
|
|
|
*/
|
2019-04-02 10:51:51 +02:00
|
|
|
INVOICE_SETTLED = 5;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
enum FailureReason {
|
2020-07-30 09:09:27 +02:00
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_NONE is set when the swap did not fail, it is either in
|
|
|
|
|
progress or succeeded.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_NONE = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't
|
|
|
|
|
possible to find a route for one or both off chain payments that met the fee
|
|
|
|
|
and timelock limits required.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_OFFCHAIN = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc
|
|
|
|
|
did not confirm before its expiry, or it confirmed too late for us to reveal
|
|
|
|
|
our preimage and claim.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_TIMEOUT = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed
|
|
|
|
|
because the on chain htlc wasn't swept before the server revoked the
|
|
|
|
|
htlc.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_SWEEP_TIMEOUT = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed
|
|
|
|
|
because the on chain htlc had a lower value than requested.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_INSUFFICIENT_VALUE = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an
|
|
|
|
|
internal error. Manual intervention such as a restart is required.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_TEMPORARY = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed
|
|
|
|
|
because the amount extended by an external loop in htlc is insufficient.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_INCORRECT_AMOUNT = 6;
|
2023-11-13 14:47:46 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_ABANDONED indicates that a swap permanently failed because
|
|
|
|
|
the client manually abandoned the swap.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_ABANDONED = 7;
|
2023-11-27 13:45:31 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap
|
|
|
|
|
wasn't published due to insufficient confirmed balance.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE = 8;
|
2024-01-12 11:35:12 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT indicates that a swap
|
|
|
|
|
wasn't published due to insufficient confirmed balance.
|
|
|
|
|
*/
|
|
|
|
|
FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT = 9;
|
2020-07-30 09:09:27 +02:00
|
|
|
}
|
|
|
|
|
|
2020-01-31 13:57:22 +01:00
|
|
|
message ListSwapsRequest {
|
2023-12-23 17:31:34 +01:00
|
|
|
// Optional filter to only return swaps that match the filter.
|
|
|
|
|
ListSwapsFilter list_swap_filter = 1;
|
2025-03-31 21:31:48 -06:00
|
|
|
|
|
|
|
|
// Set a maximum number of swaps to return in the response.
|
|
|
|
|
uint64 max_swaps = 2;
|
2023-12-23 17:31:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListSwapsFilter {
|
|
|
|
|
enum SwapTypeFilter {
|
|
|
|
|
// ANY indicates that no filter is applied.
|
|
|
|
|
ANY = 0;
|
|
|
|
|
// LOOP_OUT indicates an loop out swap (off-chain to on-chain).
|
|
|
|
|
LOOP_OUT = 1;
|
|
|
|
|
|
|
|
|
|
// LOOP_IN indicates a loop in swap (on-chain to off-chain).
|
|
|
|
|
LOOP_IN = 2;
|
|
|
|
|
}
|
|
|
|
|
// The type of the swap.
|
|
|
|
|
SwapTypeFilter swap_type = 1;
|
|
|
|
|
|
|
|
|
|
// If set, only pending swaps are returned.
|
|
|
|
|
bool pending_only = 2;
|
|
|
|
|
|
|
|
|
|
// If specified on creation, the outgoing channel set of the swap.
|
|
|
|
|
repeated uint64 outgoing_chan_set = 3;
|
|
|
|
|
|
|
|
|
|
// Label of swap to filter for.
|
|
|
|
|
string label = 4;
|
|
|
|
|
|
|
|
|
|
// If specified on creation, the last hop of the swap.
|
|
|
|
|
bytes loop_in_last_hop = 5;
|
2025-01-20 09:16:07 +01:00
|
|
|
|
|
|
|
|
// If specified, only returns asset swaps.
|
|
|
|
|
bool asset_swap_only = 6;
|
2025-03-31 21:31:48 -06:00
|
|
|
|
|
|
|
|
// If specified, returns swaps initiated after this Unix (ns) timestamp.
|
|
|
|
|
int64 start_timestamp_ns = 7;
|
2020-01-31 13:57:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListSwapsResponse {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-01-31 13:57:22 +01:00
|
|
|
The list of all currently known swaps and their status.
|
|
|
|
|
*/
|
|
|
|
|
repeated SwapStatus swaps = 1;
|
2025-03-31 21:31:48 -06:00
|
|
|
|
|
|
|
|
// Timestamp to use for paging start_timestamp_ns.
|
|
|
|
|
int64 next_start_time = 2;
|
2020-01-31 13:57:22 +01:00
|
|
|
}
|
|
|
|
|
|
2026-01-14 18:08:48 -05:00
|
|
|
// SweepHtlcRequest instructs loopd to sweep a swap HTLC via its success path.
|
|
|
|
|
message SweepHtlcRequest {
|
|
|
|
|
// Optional override for the sweep destination; defaults to a new address
|
|
|
|
|
// derived from the connected lnd wallet.
|
|
|
|
|
string dest_address = 1;
|
|
|
|
|
|
|
|
|
|
// Fee rate used for the sweep transaction in sat/vByte.
|
|
|
|
|
uint32 sat_per_vbyte = 2;
|
|
|
|
|
|
|
|
|
|
// HTLC outpoint to sweep, formatted as "txid:vout".
|
|
|
|
|
string outpoint = 3;
|
|
|
|
|
|
|
|
|
|
// Optional override for the stored swap preimage.
|
|
|
|
|
bytes preimage = 4;
|
|
|
|
|
|
|
|
|
|
// If true, publish the sweep transaction immediately.
|
|
|
|
|
bool publish = 5;
|
|
|
|
|
|
|
|
|
|
// The HTLC address whose output is being swept; used to derive the
|
|
|
|
|
// expected pkScript.
|
|
|
|
|
string htlc_address = 6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SweepHtlcResponse returns the broadcast sweep transaction.
|
|
|
|
|
message SweepHtlcResponse {
|
|
|
|
|
// Raw sweep transaction bytes.
|
|
|
|
|
bytes sweep_tx = 1;
|
|
|
|
|
|
|
|
|
|
// Miner fee paid by the sweep transaction.
|
|
|
|
|
uint64 fee_sats = 2;
|
|
|
|
|
|
|
|
|
|
// Publish outcome.
|
|
|
|
|
oneof publish {
|
|
|
|
|
PublishNotRequested not_requested = 3;
|
|
|
|
|
PublishSucceeded published = 4;
|
|
|
|
|
PublishFailed failed = 5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PublishNotRequested is returned by SweepHtlc if publishing was not requested
|
|
|
|
|
// in SweepHtlcRequest.
|
|
|
|
|
message PublishNotRequested {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PublishSucceeded is returned by SweepHtlc if publishing was requested in
|
|
|
|
|
// SweepHtlcRequest and it succeeded.
|
|
|
|
|
message PublishSucceeded {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PublishFailed is returned by SweepHtlc if publishing was requested in
|
|
|
|
|
// SweepHtlcRequest, but failed. It includes the error message.
|
|
|
|
|
message PublishFailed {
|
|
|
|
|
string error = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-31 13:57:22 +01:00
|
|
|
message SwapInfoRequest {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-01-31 13:57:22 +01:00
|
|
|
The swap identifier which currently is the hash that locks the HTLCs. When
|
2020-02-14 09:14:12 +01:00
|
|
|
using REST, this field must be encoded as URL safe base64.
|
2020-01-31 13:57:22 +01:00
|
|
|
*/
|
|
|
|
|
bytes id = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-06 21:13:50 +01:00
|
|
|
message TermsRequest {
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-14 15:13:55 +02:00
|
|
|
message InTermsResponse {
|
|
|
|
|
reserved 1, 2, 3, 4, 7;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-14 15:13:55 +02:00
|
|
|
Minimum swap amount (sat)
|
|
|
|
|
*/
|
|
|
|
|
int64 min_swap_amount = 5;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-14 15:13:55 +02:00
|
|
|
Maximum swap amount (sat)
|
|
|
|
|
*/
|
|
|
|
|
int64 max_swap_amount = 6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message OutTermsResponse {
|
2019-11-15 13:57:03 +01:00
|
|
|
reserved 1, 2, 3, 4, 7;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Minimum swap amount (sat)
|
|
|
|
|
*/
|
|
|
|
|
int64 min_swap_amount = 5;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
Maximum swap amount (sat)
|
|
|
|
|
*/
|
|
|
|
|
int64 max_swap_amount = 6;
|
2020-07-15 13:00:27 +02:00
|
|
|
|
|
|
|
|
// The minimally accepted cltv delta of the on-chain htlc.
|
|
|
|
|
int32 min_cltv_delta = 8;
|
|
|
|
|
|
|
|
|
|
// The maximally accepted cltv delta of the on-chain htlc.
|
|
|
|
|
int32 max_cltv_delta = 9;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message QuoteRequest {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2025-02-20 15:40:58 +01:00
|
|
|
The amount to swap in satoshis. In the loop-in case this can either be taken
|
|
|
|
|
from the connected lnd wallet or coin-selected from static address deposits.
|
|
|
|
|
This is controlled by the select_deposits flag. If deposit_outpoints are
|
|
|
|
|
specified, the coins are taken out of that.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
|
|
|
|
int64 amt = 1;
|
2019-06-25 14:41:45 -04:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-06-25 14:41:45 -04:00
|
|
|
The confirmation target that should be used either for the sweep of the
|
|
|
|
|
on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for
|
|
|
|
|
the confirmation of the on-chain HTLC broadcast by the swap client in the
|
|
|
|
|
case of a Loop In.
|
|
|
|
|
*/
|
|
|
|
|
int32 conf_target = 2;
|
2019-09-23 09:58:52 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-09-23 09:58:52 +02:00
|
|
|
If external_htlc is true, we expect the htlc to be published by an external
|
|
|
|
|
actor.
|
|
|
|
|
*/
|
|
|
|
|
bool external_htlc = 3;
|
2020-01-07 13:43:39 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-01-07 13:43:39 +01:00
|
|
|
The latest time (in unix seconds) we allow the server to wait before
|
|
|
|
|
publishing the HTLC on chain. Setting this to a larger value will give the
|
|
|
|
|
server the opportunity to batch multiple swaps together, and wait for
|
|
|
|
|
low-fee periods before publishing the HTLC, potentially resulting in a
|
2020-02-21 09:55:52 +01:00
|
|
|
lower total swap fee. This only has an effect on loop out quotes.
|
2020-01-07 13:43:39 +01:00
|
|
|
*/
|
|
|
|
|
uint64 swap_publication_deadline = 4;
|
2021-05-10 16:55:53 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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 loop_in_last_hop = 5;
|
2021-07-28 18:11:45 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Optional route hints to reach the destination through private channels.
|
|
|
|
|
*/
|
2021-12-13 13:56:40 +02:00
|
|
|
repeated looprpc.RouteHint loop_in_route_hints = 6;
|
2021-10-19 18:05:59 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Private indicates whether the destination node should be considered
|
|
|
|
|
private. In which case, loop will generate hophints to assist with
|
|
|
|
|
probing and payment.
|
|
|
|
|
*/
|
|
|
|
|
bool private = 7;
|
2024-06-06 15:19:10 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Static address deposit outpoints that will be quoted for. This option only
|
2025-02-20 15:40:58 +01:00
|
|
|
pertains to loop in swaps. If the amt field is set as well the respective
|
|
|
|
|
partial amount will be swapped. Cannot be used in conjunction with
|
|
|
|
|
auto_select_deposits.
|
2024-06-06 15:19:10 +02:00
|
|
|
*/
|
|
|
|
|
repeated string deposit_outpoints = 8;
|
2025-01-09 16:22:28 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The optional asset information to use for the swap. If set, the quote will
|
|
|
|
|
be returned in the specified asset.
|
|
|
|
|
*/
|
|
|
|
|
AssetLoopOutRequest asset_info = 9;
|
2025-02-20 15:40:58 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
In the legacy loop-in case this field must be set to false.
|
|
|
|
|
If set to true, the swap amount will be automatically selected from the
|
|
|
|
|
static address deposits. If set to true, deposit_outpoints must be empty.
|
|
|
|
|
This option only pertains to loop in swaps.
|
|
|
|
|
*/
|
|
|
|
|
bool auto_select_deposits = 10;
|
2025-10-01 08:39:38 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
If set to true the server will immediately publish the swap in exchange for
|
|
|
|
|
a higher fee. This can be useful if the client expects change from a swap.
|
|
|
|
|
Note that this feature is only available for static address loop in swaps.
|
|
|
|
|
*/
|
|
|
|
|
bool fast = 11;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-14 15:20:37 +02:00
|
|
|
message InQuoteResponse {
|
|
|
|
|
reserved 2, 4;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-14 15:20:37 +02:00
|
|
|
The fee that the swap server is charging for the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 swap_fee_sat = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An estimate of the on-chain fee that needs to be paid to publish the HTLC
|
|
|
|
|
If a miner fee of 0 is returned, it means the external_htlc flag was set for
|
|
|
|
|
a loop in and the fee estimation was skipped. If a miner fee of -1 is
|
|
|
|
|
returned, it means lnd's wallet tried to estimate the fee but was unable to
|
|
|
|
|
create a sample estimation transaction because not enough funds are
|
|
|
|
|
available. An information message should be shown to the user in this case.
|
|
|
|
|
*/
|
|
|
|
|
int64 htlc_publish_fee_sat = 3;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-07-14 15:20:37 +02:00
|
|
|
On-chain cltv expiry delta
|
|
|
|
|
*/
|
|
|
|
|
int32 cltv_delta = 5;
|
2021-03-04 17:39:00 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The confirmation target to be used to publish the on-chain HTLC.
|
|
|
|
|
*/
|
|
|
|
|
int32 conf_target = 6;
|
2025-10-07 10:57:14 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
If the quote request was for a static address loop in and only contained
|
|
|
|
|
deposit outpoints the quote response will return the total amount of the
|
|
|
|
|
selected deposits.
|
|
|
|
|
*/
|
|
|
|
|
int64 quoted_amt = 7;
|
2020-07-14 15:20:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message OutQuoteResponse {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-06 21:13:50 +01:00
|
|
|
The fee that the swap server is charging for the swap.
|
|
|
|
|
*/
|
2020-07-14 15:20:37 +02:00
|
|
|
int64 swap_fee_sat = 1;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-03-12 15:34:45 -07:00
|
|
|
The part of the swap fee that is requested as a prepayment.
|
2019-03-06 21:13:50 +01:00
|
|
|
*/
|
2020-07-14 15:20:37 +02:00
|
|
|
int64 prepay_amt_sat = 2;
|
2019-03-06 21:13:50 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2020-02-21 09:55:52 +01:00
|
|
|
An estimate of the on-chain fee that needs to be paid to sweep the HTLC for
|
2020-07-14 15:20:37 +02:00
|
|
|
a loop out.
|
|
|
|
|
*/
|
|
|
|
|
int64 htlc_sweep_fee_sat = 3;
|
2019-10-08 22:28:20 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-10-08 22:28:20 +02:00
|
|
|
The node pubkey where the swap payment needs to be paid
|
|
|
|
|
to. This can be used to test connectivity before initiating the swap.
|
|
|
|
|
*/
|
|
|
|
|
bytes swap_payment_dest = 4;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-10-08 22:28:20 +02:00
|
|
|
On-chain cltv expiry delta
|
|
|
|
|
*/
|
|
|
|
|
int32 cltv_delta = 5;
|
2021-03-04 17:39:00 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The confirmation target to be used for the sweep of the on-chain HTLC.
|
|
|
|
|
*/
|
|
|
|
|
int32 conf_target = 6;
|
2025-01-09 16:22:28 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
If the request was for an asset swap, the quote will return the rfq ids
|
|
|
|
|
that will be used to pay for the swap and prepay invoices.
|
|
|
|
|
*/
|
|
|
|
|
AssetRfqInfo asset_rfq_info = 7;
|
2019-03-06 21:13:50 +01:00
|
|
|
}
|
2019-11-15 13:57:03 +01:00
|
|
|
|
2021-05-10 16:55:53 +02:00
|
|
|
message ProbeRequest {
|
|
|
|
|
/*
|
|
|
|
|
The amount to probe.
|
|
|
|
|
*/
|
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Optional last hop of the route to probe.
|
|
|
|
|
*/
|
|
|
|
|
bytes last_hop = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Optional route hints to reach the destination through private channels.
|
|
|
|
|
*/
|
2021-12-13 13:56:40 +02:00
|
|
|
repeated looprpc.RouteHint route_hints = 3;
|
2021-05-10 16:55:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ProbeResponse {
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-15 13:57:03 +01:00
|
|
|
message TokensRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message TokensResponse {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
List of all tokens the daemon knows of, including old/expired tokens.
|
|
|
|
|
*/
|
2024-04-17 15:57:59 -03:00
|
|
|
repeated L402Token tokens = 1;
|
2019-11-15 13:57:03 +01:00
|
|
|
}
|
|
|
|
|
|
2024-10-30 14:21:36 +01:00
|
|
|
message FetchL402TokenRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FetchL402TokenResponse {
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-17 15:57:59 -03:00
|
|
|
message L402Token {
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The base macaroon that was baked by the auth server.
|
|
|
|
|
*/
|
|
|
|
|
bytes base_macaroon = 1;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The payment hash of the payment that was paid to obtain the token.
|
|
|
|
|
*/
|
|
|
|
|
bytes payment_hash = 2;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The preimage of the payment hash, knowledge of this is proof that the
|
|
|
|
|
payment has been paid. If the preimage is set to all zeros, this means the
|
|
|
|
|
payment is still pending and the token is not yet fully valid.
|
|
|
|
|
*/
|
|
|
|
|
bytes payment_preimage = 3;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The amount of millisatoshis that was paid to get the token.
|
|
|
|
|
*/
|
|
|
|
|
int64 amount_paid_msat = 4;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The amount of millisatoshis paid in routing fee to pay for the token.
|
|
|
|
|
*/
|
|
|
|
|
int64 routing_fee_paid_msat = 5;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
The creation time of the token as UNIX timestamp in seconds.
|
|
|
|
|
*/
|
|
|
|
|
int64 time_created = 6;
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
Indicates whether the token is expired or still valid.
|
|
|
|
|
*/
|
|
|
|
|
bool expired = 7;
|
2020-01-31 13:57:22 +01:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
/*
|
2019-11-15 13:57:03 +01:00
|
|
|
Identifying attribute of this token in the store. Currently represents the
|
|
|
|
|
file name of the token where it's stored on the file system.
|
|
|
|
|
*/
|
|
|
|
|
string storage_name = 8;
|
2023-06-22 17:30:33 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The l402 ID of the token.
|
|
|
|
|
*/
|
|
|
|
|
string id = 9;
|
2019-11-15 13:57:03 +01:00
|
|
|
}
|
2020-09-01 09:58:09 +02:00
|
|
|
|
2023-05-24 12:39:47 +02:00
|
|
|
message LoopStats {
|
|
|
|
|
/*
|
|
|
|
|
Number of currently pending swaps.
|
|
|
|
|
*/
|
|
|
|
|
uint64 pending_count = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Number of succeeded swaps.
|
|
|
|
|
*/
|
|
|
|
|
uint64 success_count = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Number failed swaps.
|
|
|
|
|
*/
|
|
|
|
|
uint64 fail_count = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The sum of all pending swap amounts.
|
|
|
|
|
*/
|
|
|
|
|
int64 sum_pending_amt = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The sum of all succeeded swap amounts.
|
|
|
|
|
*/
|
|
|
|
|
int64 sum_succeeded_amt = 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GetInfoRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GetInfoResponse {
|
|
|
|
|
/*
|
|
|
|
|
The current daemon version.
|
|
|
|
|
*/
|
|
|
|
|
string version = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The network the daemon is running on.
|
|
|
|
|
*/
|
|
|
|
|
string network = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Host and port of the loopd grpc server.
|
|
|
|
|
*/
|
|
|
|
|
string rpc_listen = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Host and port of the loopd rest server.
|
|
|
|
|
*/
|
|
|
|
|
string rest_listen = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Loop's macaroon path that clients use to talk to the daemon.
|
|
|
|
|
*/
|
|
|
|
|
string macaroon_path = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Loop's tls cert path
|
|
|
|
|
*/
|
|
|
|
|
string tls_cert_path = 6;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Statistics about loop outs.
|
|
|
|
|
*/
|
|
|
|
|
LoopStats loop_out_stats = 7;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Statistics about loop ins.
|
|
|
|
|
*/
|
|
|
|
|
LoopStats loop_in_stats = 8;
|
2025-04-04 12:32:33 +02:00
|
|
|
|
|
|
|
|
/*
|
2025-05-22 12:10:30 +02:00
|
|
|
The Git commit hash the Loop binary build was based on. If the build had
|
|
|
|
|
uncommited changes, this field will contain the most recent commit hash,
|
|
|
|
|
suffixed by "-dirty".
|
2025-04-04 12:32:33 +02:00
|
|
|
*/
|
|
|
|
|
string commit_hash = 9;
|
2023-05-24 12:39:47 +02:00
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message GetLiquidityParamsRequest {
|
|
|
|
|
}
|
2020-09-01 09:58:09 +02:00
|
|
|
|
2026-04-10 23:41:52 -05:00
|
|
|
enum LoopInSource {
|
|
|
|
|
/*
|
|
|
|
|
Use the legacy wallet-funded loop-in flow.
|
|
|
|
|
*/
|
|
|
|
|
LOOP_IN_SOURCE_WALLET = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Use deposited static-address funds for loop-in autoloops.
|
|
|
|
|
*/
|
|
|
|
|
LOOP_IN_SOURCE_STATIC_ADDRESS = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message LiquidityParameters {
|
2020-09-01 09:58:09 +02:00
|
|
|
/*
|
|
|
|
|
A set of liquidity rules that describe the desired liquidity balance.
|
|
|
|
|
*/
|
|
|
|
|
repeated LiquidityRule rules = 1;
|
2020-09-30 12:34:10 +02:00
|
|
|
|
2021-03-02 14:42:04 +02:00
|
|
|
/*
|
|
|
|
|
The parts per million of swap amount that is allowed to be allocated to swap
|
2021-05-25 16:33:44 +02:00
|
|
|
fees. This value is applied across swap categories and may not be set in
|
2021-03-02 14:42:04 +02:00
|
|
|
conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay
|
|
|
|
|
routing, max prepay and max miner fee.
|
|
|
|
|
*/
|
|
|
|
|
uint64 fee_ppm = 16;
|
|
|
|
|
|
2020-09-30 12:34:10 +02:00
|
|
|
/*
|
|
|
|
|
The limit we place on our estimated sweep cost for a swap in sat/vByte. If
|
|
|
|
|
the estimated fee for our sweep transaction within the specified
|
|
|
|
|
confirmation target is above this value, we will not suggest any swaps.
|
|
|
|
|
*/
|
|
|
|
|
uint64 sweep_fee_rate_sat_per_vbyte = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum fee paid to the server for facilitating the swap, expressed
|
|
|
|
|
as parts per million of the swap volume.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_swap_fee_ppm = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum fee paid to route the swap invoice off chain, expressed as
|
|
|
|
|
parts per million of the volume being routed.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_routing_fee_ppm = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum fee paid to route the prepay invoice off chain, expressed as
|
|
|
|
|
parts per million of the volume being routed.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_prepay_routing_fee_ppm = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum no-show penalty in satoshis paid for a swap.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_prepay_sat = 6;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum miner fee we will pay to sweep the swap on chain. Note that we
|
|
|
|
|
will not suggest a swap if the estimate is above the sweep limit set by
|
|
|
|
|
these parameters, and we use the current fee estimate to sweep on chain so
|
|
|
|
|
this value is only a cap placed on the amount we spend on fees in the case
|
|
|
|
|
where the swap needs to be claimed on chain, but fees have suddenly spiked.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_miner_fee_sat = 7;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The number of blocks from the on-chain HTLC's confirmation height that it
|
|
|
|
|
should be swept within.
|
|
|
|
|
*/
|
|
|
|
|
int32 sweep_conf_target = 8;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The amount of time we require pass since a channel was part of a failed
|
|
|
|
|
swap due to off chain payment failure until it will be considered for swap
|
|
|
|
|
suggestions again, expressed in seconds.
|
|
|
|
|
*/
|
|
|
|
|
uint64 failure_backoff_sec = 9;
|
2020-10-12 13:34:56 +02:00
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Set to true to enable automatic dispatch of swaps. All swaps will be limited
|
|
|
|
|
to the fee categories set by these parameters, and total expenditure will
|
2021-02-03 08:54:48 +02:00
|
|
|
be limited to the autoloop budget.
|
2020-10-12 13:34:56 +02:00
|
|
|
*/
|
2021-02-03 08:54:48 +02:00
|
|
|
bool autoloop = 10;
|
2020-10-12 13:34:56 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total budget for automatically dispatched swaps since the budget start
|
|
|
|
|
time, expressed in satoshis.
|
|
|
|
|
*/
|
2021-02-03 08:54:48 +02:00
|
|
|
uint64 autoloop_budget_sat = 11;
|
2020-10-12 13:34:56 +02:00
|
|
|
|
2023-03-14 13:21:20 +02:00
|
|
|
/*
|
|
|
|
|
Deprecated, use autoloop_budget_refresh_period_sec. The start time for
|
|
|
|
|
autoloop budget, expressed as a unix timestamp in seconds. If this value is
|
|
|
|
|
0, the budget will be applied for all automatically dispatched swaps. Swaps
|
|
|
|
|
that were completed before this date will not be included in budget
|
|
|
|
|
calculations.
|
|
|
|
|
*/
|
|
|
|
|
uint64 autoloop_budget_start_sec = 12 [deprecated = true];
|
|
|
|
|
|
2020-10-12 13:34:56 +02:00
|
|
|
/*
|
|
|
|
|
The maximum number of automatically dispatched swaps that we allow to be in
|
|
|
|
|
flight at any point in time.
|
|
|
|
|
*/
|
|
|
|
|
uint64 auto_max_in_flight = 13;
|
2020-12-01 12:20:38 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The minimum amount, expressed in satoshis, that the autoloop client will
|
|
|
|
|
dispatch a swap for. This value is subject to the server-side limits
|
|
|
|
|
specified by the LoopOutTerms endpoint.
|
|
|
|
|
*/
|
|
|
|
|
uint64 min_swap_amount = 14;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum amount, expressed in satoshis, that the autoloop client will
|
|
|
|
|
dispatch a swap for. This value is subject to the server-side limits
|
|
|
|
|
specified by the LoopOutTerms endpoint.
|
|
|
|
|
*/
|
|
|
|
|
uint64 max_swap_amount = 15;
|
2021-12-15 09:11:46 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The confirmation target for loop in on-chain htlcs.
|
|
|
|
|
*/
|
|
|
|
|
int32 htlc_conf_target = 17;
|
2022-12-07 15:19:11 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The destination address to use for autoloop loop outs. Set to "default" in
|
|
|
|
|
order to revert to default behavior.
|
|
|
|
|
*/
|
|
|
|
|
string autoloop_dest_address = 18;
|
2023-02-08 22:26:20 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The period over which the autoloop budget is refreshed, expressed in
|
|
|
|
|
seconds.
|
|
|
|
|
*/
|
|
|
|
|
uint64 autoloop_budget_refresh_period_sec = 19;
|
2023-03-14 16:49:08 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The time at which the autoloop budget was last refreshed, expressed as a
|
|
|
|
|
UNIX timestamp in seconds.
|
|
|
|
|
*/
|
|
|
|
|
uint64 autoloop_budget_last_refresh = 20;
|
2023-04-11 15:13:06 +03:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Set to true to enable easy autoloop. If set, all channel/peer rules will be
|
|
|
|
|
overridden and the client will automatically dispatch swaps in order to meet
|
|
|
|
|
the configured local balance target size. Currently only loop out is
|
|
|
|
|
supported, meaning that easy autoloop can only reduce the funds that are
|
|
|
|
|
held as balance in channels.
|
|
|
|
|
*/
|
|
|
|
|
bool easy_autoloop = 21;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The local balance target size, expressed in satoshis. This is used by easy
|
|
|
|
|
autoloop to determine how much liquidity should be maintained in channels.
|
|
|
|
|
*/
|
|
|
|
|
uint64 easy_autoloop_local_target_sat = 22;
|
2023-07-04 18:45:18 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An alternative destination address source for the swap. This field
|
|
|
|
|
represents the name of the account in the backing lnd instance.
|
|
|
|
|
Refer to lnd's wallet import functions for reference.
|
|
|
|
|
*/
|
|
|
|
|
string account = 23;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The address type of the account specified in the account field.
|
|
|
|
|
*/
|
|
|
|
|
AddressType account_addr_type = 24;
|
2025-02-17 10:27:40 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
A map of asset parameters to use for swaps. The key is the asset id and the
|
|
|
|
|
value is the parameters to use for swaps in that asset.
|
|
|
|
|
*/
|
|
|
|
|
map<string, EasyAssetAutoloopParams> easy_asset_params = 25;
|
2025-04-29 17:49:11 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Set to true to enable fast swap publication. If set, the server will
|
|
|
|
|
* publish the HTLC immediately after receiving the swap request. This
|
|
|
|
|
* setting has direct implications on the swap fees, as fast swaps may
|
|
|
|
|
* not be able to be batched with other swaps.
|
|
|
|
|
*/
|
|
|
|
|
bool fast_swap_publication = 26;
|
2025-10-08 16:46:49 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
A list of peers (their public keys) that should be excluded from the easy
|
|
|
|
|
autoloop run. If set, channels connected to these peers won't be
|
|
|
|
|
considered for easy autoloop swaps.
|
|
|
|
|
*/
|
|
|
|
|
repeated bytes easy_autoloop_excluded_peers = 27;
|
2026-04-10 23:41:52 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Selects which source autoloop uses for loop-in rules.
|
|
|
|
|
*/
|
|
|
|
|
LoopInSource loop_in_source = 28;
|
2025-02-17 10:27:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message EasyAssetAutoloopParams {
|
|
|
|
|
/*
|
|
|
|
|
Set to true to enable easy autoloop for this asset. If set the client will
|
|
|
|
|
automatically dispatch swaps in order to meet the configured local balance
|
|
|
|
|
target size. Currently only loop out is supported, meaning that easy
|
|
|
|
|
autoloop can only reduce the funds that are held as balance in channels.
|
|
|
|
|
*/
|
|
|
|
|
bool enabled = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The local balance target size, expressed in the asset's base units. This is
|
|
|
|
|
used by easy autoloop to determine how much liquidity should be maintained
|
|
|
|
|
in channels.
|
|
|
|
|
*/
|
|
|
|
|
uint64 local_target_asset_amt = 2;
|
2020-09-01 09:58:09 +02:00
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
enum LiquidityRuleType {
|
2020-09-01 09:58:09 +02:00
|
|
|
UNKNOWN = 0;
|
|
|
|
|
THRESHOLD = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message LiquidityRule {
|
2020-09-01 09:58:09 +02:00
|
|
|
/*
|
|
|
|
|
The short channel ID of the channel that this rule should be applied to.
|
2021-02-16 13:31:51 +02:00
|
|
|
This field may not be set when the pubkey field is set.
|
2020-09-01 09:58:09 +02:00
|
|
|
*/
|
|
|
|
|
uint64 channel_id = 1;
|
|
|
|
|
|
2021-11-30 13:18:28 +02:00
|
|
|
// The type of swap that will be dispatched for this rule.
|
|
|
|
|
SwapType swap_type = 6;
|
|
|
|
|
|
2021-05-25 16:33:44 +02:00
|
|
|
/*
|
2021-02-16 13:31:51 +02:00
|
|
|
The public key of the peer that this rule should be applied to. This field
|
|
|
|
|
may not be set when the channel id field is set.
|
|
|
|
|
*/
|
|
|
|
|
bytes pubkey = 5;
|
|
|
|
|
|
2020-09-01 09:58:09 +02:00
|
|
|
/*
|
|
|
|
|
Type indicates the type of rule that this message rule represents. Setting
|
|
|
|
|
this value will determine which fields are used in the message. The comments
|
|
|
|
|
on each field in this message will be prefixed with the LiquidityRuleType
|
|
|
|
|
they belong to.
|
|
|
|
|
*/
|
|
|
|
|
LiquidityRuleType type = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
THRESHOLD: The percentage of total capacity that incoming capacity should
|
|
|
|
|
not drop beneath.
|
|
|
|
|
*/
|
|
|
|
|
uint32 incoming_threshold = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
THRESHOLD: The percentage of total capacity that outgoing capacity should
|
|
|
|
|
not drop beneath.
|
|
|
|
|
*/
|
|
|
|
|
uint32 outgoing_threshold = 4;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message SetLiquidityParamsRequest {
|
2020-09-01 09:58:09 +02:00
|
|
|
/*
|
|
|
|
|
Parameters is the desired new set of parameters for the liquidity management
|
|
|
|
|
subsystem. Note that the current set of parameters will be completely
|
|
|
|
|
overwritten by the parameters provided (if they are valid), so the full set
|
|
|
|
|
of parameters should be provided for each call.
|
|
|
|
|
*/
|
|
|
|
|
LiquidityParameters parameters = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message SetLiquidityParamsResponse {
|
|
|
|
|
}
|
2020-09-03 10:36:44 +02:00
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message SuggestSwapsRequest {
|
2020-09-03 10:36:44 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-08 09:39:03 +02:00
|
|
|
enum AutoReason {
|
|
|
|
|
AUTO_REASON_UNKNOWN = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Budget not started indicates that we do not recommend any swaps because
|
2021-02-08 09:39:03 +02:00
|
|
|
the start time for our budget has not arrived yet.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_BUDGET_NOT_STARTED = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Sweep fees indicates that the estimated fees to sweep swaps are too high
|
2021-02-08 09:39:03 +02:00
|
|
|
right now.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_SWEEP_FEES = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Budget elapsed indicates that the autoloop budget for the period has been
|
2021-02-08 09:39:03 +02:00
|
|
|
elapsed.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_BUDGET_ELAPSED = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
In flight indicates that the limit on in-flight automatically dispatched
|
2021-02-08 09:39:03 +02:00
|
|
|
swaps has already been reached.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_IN_FLIGHT = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Swap fee indicates that the server fee for a specific swap is too high.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_SWAP_FEE = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Miner fee indicates that the miner fee for a specific swap is to high.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_MINER_FEE = 6;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Prepay indicates that the prepay fee for a specific swap is too high.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_PREPAY = 7;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Failure backoff indicates that a swap has recently failed for this target,
|
|
|
|
|
and the backoff period has not yet passed.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_FAILURE_BACKOFF = 8;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Loop out indicates that a loop out swap is currently utilizing the channel,
|
|
|
|
|
so it is not eligible.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_LOOP_OUT = 9;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Loop In indicates that a loop in swap is currently in flight for the peer,
|
2021-02-08 09:39:03 +02:00
|
|
|
so it is not eligible.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_LOOP_IN = 10;
|
|
|
|
|
|
|
|
|
|
/*
|
2021-05-25 16:33:44 +02:00
|
|
|
Liquidity ok indicates that a target meets the liquidity balance expressed
|
2021-02-08 09:39:03 +02:00
|
|
|
in its rule, so no swap is needed.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_LIQUIDITY_OK = 11;
|
|
|
|
|
|
2021-05-25 16:33:44 +02:00
|
|
|
/*
|
|
|
|
|
Budget insufficient indicates that we cannot perform a swap because we do
|
|
|
|
|
not have enough pending budget available. This differs from budget elapsed,
|
|
|
|
|
because we still have some budget available, but we have allocated it to
|
2021-02-08 09:39:03 +02:00
|
|
|
other swaps.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_BUDGET_INSUFFICIENT = 12;
|
2021-03-02 14:42:03 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Fee insufficient indicates that the fee estimate for a swap is higher than
|
|
|
|
|
the portion of total swap amount that we allow fees to consume.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_FEE_INSUFFICIENT = 13;
|
2026-04-10 23:58:29 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
No static loop-in candidate indicates that static loop-in autoloop was
|
|
|
|
|
selected, but no full-deposit static candidate fit the rule.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_STATIC_LOOP_IN_NO_CANDIDATE = 14;
|
2026-04-13 01:17:30 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Custom channel data indicates that the target channel carries custom
|
|
|
|
|
channel data and is excluded from the standard autoloop planner.
|
|
|
|
|
*/
|
|
|
|
|
AUTO_REASON_CUSTOM_CHANNEL_DATA = 15;
|
2021-05-25 16:33:44 +02:00
|
|
|
}
|
2021-02-08 09:39:03 +02:00
|
|
|
|
|
|
|
|
message Disqualified {
|
|
|
|
|
/*
|
|
|
|
|
The short channel ID of the channel that was excluded from our suggestions.
|
|
|
|
|
*/
|
2021-05-25 16:33:44 +02:00
|
|
|
uint64 channel_id = 1;
|
|
|
|
|
|
2021-02-16 13:31:51 +02:00
|
|
|
/*
|
|
|
|
|
The public key of the peer that was excluded from our suggestions.
|
|
|
|
|
*/
|
|
|
|
|
bytes pubkey = 3;
|
2021-02-08 09:39:03 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The reason that we excluded the channel from the our suggestions.
|
|
|
|
|
*/
|
|
|
|
|
AutoReason reason = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-06 10:42:59 +01:00
|
|
|
message SuggestSwapsResponse {
|
2020-09-03 10:36:44 +02:00
|
|
|
/*
|
|
|
|
|
The set of recommended loop outs.
|
|
|
|
|
*/
|
2020-11-06 10:42:59 +01:00
|
|
|
repeated LoopOutRequest loop_out = 1;
|
2021-02-08 09:39:03 +02:00
|
|
|
|
2021-12-15 09:10:28 +02:00
|
|
|
/*
|
|
|
|
|
The set of recommended loop in swaps
|
|
|
|
|
*/
|
|
|
|
|
repeated LoopInRequest loop_in = 3;
|
|
|
|
|
|
2026-04-10 23:58:29 -05:00
|
|
|
/*
|
|
|
|
|
The set of recommended static-address loop in swaps.
|
|
|
|
|
*/
|
|
|
|
|
repeated StaticAddressLoopInRequest static_loop_in = 4;
|
|
|
|
|
|
2021-02-08 09:39:03 +02:00
|
|
|
/*
|
|
|
|
|
Disqualified contains the set of channels that swaps are not recommended
|
|
|
|
|
for.
|
|
|
|
|
*/
|
|
|
|
|
repeated Disqualified disqualified = 2;
|
2020-09-03 10:36:44 +02:00
|
|
|
}
|
2023-11-13 14:47:46 +01:00
|
|
|
|
|
|
|
|
message AbandonSwapRequest {
|
|
|
|
|
/*
|
|
|
|
|
The swap identifier which currently is the hash that locks the HTLCs. When
|
|
|
|
|
using REST, this field must be encoded as URL safe base64.
|
|
|
|
|
*/
|
|
|
|
|
bytes id = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
A flag that tries to ensure that the client understands that they are
|
|
|
|
|
risking loss of funds by abandoning a swap. This could happen if an
|
|
|
|
|
abandoned swap would wait on a timeout sweep by the client.
|
|
|
|
|
*/
|
|
|
|
|
bool i_know_what_i_am_doing = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message AbandonSwapResponse {
|
2023-08-25 01:42:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListReservationsRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListReservationsResponse {
|
|
|
|
|
/*
|
|
|
|
|
The list of all currently known reservations and their status.
|
|
|
|
|
*/
|
|
|
|
|
repeated ClientReservation reservations = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ClientReservation {
|
|
|
|
|
/*
|
|
|
|
|
The reservation id that identifies this reservation.
|
|
|
|
|
*/
|
|
|
|
|
bytes reservation_id = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The state the reservation is in.
|
|
|
|
|
*/
|
|
|
|
|
string state = 2;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-08-25 01:42:35 +02:00
|
|
|
/*
|
2024-02-14 17:00:19 +01:00
|
|
|
The amount that the reservation is for.
|
2023-08-25 01:42:35 +02:00
|
|
|
*/
|
|
|
|
|
uint64 amount = 3;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-08-25 01:42:35 +02:00
|
|
|
/*
|
2024-02-14 17:00:19 +01:00
|
|
|
The transaction id of the reservation.
|
2023-08-25 01:42:35 +02:00
|
|
|
*/
|
2023-10-25 23:32:06 +02:00
|
|
|
string tx_id = 4;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-08-25 01:42:35 +02:00
|
|
|
/*
|
2024-02-14 17:00:19 +01:00
|
|
|
The vout of the reservation.
|
2023-08-25 01:42:35 +02:00
|
|
|
*/
|
|
|
|
|
uint32 vout = 5;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-08-25 01:42:35 +02:00
|
|
|
/*
|
2024-02-14 17:00:19 +01:00
|
|
|
The expiry of the reservation.
|
2023-08-25 01:42:35 +02:00
|
|
|
*/
|
|
|
|
|
uint32 expiry = 6;
|
2023-10-25 23:32:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message InstantOutRequest {
|
|
|
|
|
/*
|
|
|
|
|
The reservations to use for the swap.
|
|
|
|
|
*/
|
|
|
|
|
repeated bytes reservation_ids = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
A restriction on the channel set that may be used to loop out. The actual
|
|
|
|
|
channel(s) that will be used are selected based on the lowest routing fee
|
|
|
|
|
for the swap payment to the server.
|
|
|
|
|
*/
|
2024-03-01 16:56:22 +01:00
|
|
|
repeated uint64 outgoing_chan_set = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An optional address to sweep the onchain funds to. If not set, the funds
|
|
|
|
|
will be swept to the wallet's internal address.
|
|
|
|
|
*/
|
|
|
|
|
string dest_addr = 3;
|
2023-10-25 23:32:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message InstantOutResponse {
|
|
|
|
|
/*
|
|
|
|
|
The hash of the swap preimage.
|
|
|
|
|
*/
|
|
|
|
|
bytes instant_out_hash = 1;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-10-25 23:32:06 +02:00
|
|
|
/*
|
|
|
|
|
The transaction id of the sweep transaction.
|
|
|
|
|
*/
|
|
|
|
|
string sweep_tx_id = 2;
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2023-10-25 23:32:06 +02:00
|
|
|
/*
|
|
|
|
|
The state of the swap.
|
|
|
|
|
*/
|
|
|
|
|
string state = 3;
|
2024-02-06 19:15:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message InstantOutQuoteRequest {
|
|
|
|
|
/*
|
|
|
|
|
The amount to swap in satoshis.
|
|
|
|
|
*/
|
|
|
|
|
uint64 amt = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
2025-04-08 09:50:51 +02:00
|
|
|
Deprecated: use 'reservation_ids' instead.
|
2024-02-06 19:15:27 +01:00
|
|
|
The amount of reservations to use for the swap.
|
|
|
|
|
*/
|
2025-04-08 09:50:51 +02:00
|
|
|
int32 num_reservations = 2 [deprecated = true];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The reservations to use for the swap.
|
|
|
|
|
*/
|
|
|
|
|
repeated bytes reservation_ids = 3;
|
2024-02-06 19:15:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message InstantOutQuoteResponse {
|
|
|
|
|
/*
|
|
|
|
|
The fee that the swap service is charging for the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 service_fee_sat = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The estimated on-chain fee that needs to be paid to publish the Sweepless
|
|
|
|
|
Sweep.
|
|
|
|
|
*/
|
|
|
|
|
int64 sweep_fee_sat = 2;
|
2024-03-01 14:34:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListInstantOutsRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListInstantOutsResponse {
|
|
|
|
|
/*
|
|
|
|
|
The list of all currently known instant out swaps and their status.
|
|
|
|
|
*/
|
|
|
|
|
repeated InstantOut swaps = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message InstantOut {
|
|
|
|
|
/*
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The used reservations for the swap.
|
|
|
|
|
*/
|
|
|
|
|
repeated bytes reservation_ids = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The sweep transaction id of the swap.
|
|
|
|
|
*/
|
|
|
|
|
string sweep_tx_id = 5;
|
|
|
|
|
}
|
2024-02-14 17:00:19 +01:00
|
|
|
|
2024-02-26 09:06:06 +01:00
|
|
|
message NewStaticAddressRequest {
|
2024-02-14 17:00:19 +01:00
|
|
|
/*
|
|
|
|
|
The client's public key for the 2-of-2 MuSig2 taproot static address.
|
|
|
|
|
*/
|
|
|
|
|
bytes client_key = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-26 09:06:06 +01:00
|
|
|
message NewStaticAddressResponse {
|
2024-02-14 17:00:19 +01:00
|
|
|
/*
|
|
|
|
|
The taproot static address.
|
|
|
|
|
*/
|
|
|
|
|
string address = 1;
|
2023-11-09 19:20:01 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The CSV expiry of the static address.
|
|
|
|
|
*/
|
|
|
|
|
uint32 expiry = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-26 09:06:06 +01:00
|
|
|
message ListUnspentDepositsRequest {
|
2023-11-09 19:20:01 +01:00
|
|
|
/*
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-26 09:06:06 +01:00
|
|
|
message ListUnspentDepositsResponse {
|
2023-11-09 19:20:01 +01:00
|
|
|
/*
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The outpoint in the form txid:index.
|
|
|
|
|
*/
|
|
|
|
|
string outpoint = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The number of confirmations for the Utxo.
|
|
|
|
|
*/
|
|
|
|
|
int64 confirmations = 4;
|
2024-02-14 17:00:19 +01:00
|
|
|
}
|
2024-05-06 14:13:15 +02:00
|
|
|
|
|
|
|
|
message WithdrawDepositsRequest {
|
|
|
|
|
/*
|
|
|
|
|
The outpoints of the deposits to withdraw.
|
|
|
|
|
*/
|
2025-05-21 14:08:54 +02:00
|
|
|
repeated lnrpc.OutPoint outpoints = 1;
|
2024-05-06 14:13:15 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
If set to true, all deposits will be withdrawn.
|
|
|
|
|
*/
|
|
|
|
|
bool all = 2;
|
2024-11-29 14:47:26 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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;
|
2024-12-03 13:41:43 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The amount in satoshis that should be withdrawn from the selected deposits.
|
|
|
|
|
If there is change, it will be sent back to the static address. The fees for
|
|
|
|
|
the transaction are taken from the change output. If the change is below
|
|
|
|
|
the dust limit, there won't be a change output and the dust goes towards
|
|
|
|
|
fees.
|
|
|
|
|
*/
|
|
|
|
|
int64 amount = 5;
|
2024-05-06 14:13:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message WithdrawDepositsResponse {
|
2024-11-19 13:15:53 +01:00
|
|
|
/*
|
|
|
|
|
The transaction hash of the withdrawal transaction.
|
|
|
|
|
*/
|
|
|
|
|
string withdrawal_tx_hash = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
2025-04-23 21:33:08 -03:00
|
|
|
The destination address of the withdrawal transaction.
|
2024-11-19 13:15:53 +01:00
|
|
|
*/
|
2025-04-23 21:33:08 -03:00
|
|
|
string address = 2;
|
2024-05-06 14:13:15 +02:00
|
|
|
}
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
message ListStaticAddressDepositsRequest {
|
2024-06-05 13:33:47 +02:00
|
|
|
/*
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
message ListStaticAddressDepositsResponse {
|
|
|
|
|
/*
|
|
|
|
|
A list of all deposits that match the filtered state.
|
|
|
|
|
*/
|
|
|
|
|
repeated Deposit filtered_deposits = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-13 11:34:02 +02:00
|
|
|
message ListStaticAddressWithdrawalRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListStaticAddressWithdrawalResponse {
|
|
|
|
|
/*
|
|
|
|
|
A list of all static address withdrawals.
|
|
|
|
|
*/
|
|
|
|
|
repeated StaticAddressWithdrawal withdrawals = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
message ListStaticAddressSwapsRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListStaticAddressSwapsResponse {
|
|
|
|
|
/*
|
|
|
|
|
A list of all swaps known static address loop-in swaps.
|
|
|
|
|
*/
|
|
|
|
|
repeated StaticAddressLoopInSwap swaps = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message StaticAddressSummaryRequest {
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-05 13:33:47 +02:00
|
|
|
message StaticAddressSummaryResponse {
|
|
|
|
|
/*
|
|
|
|
|
The static address of the client.
|
|
|
|
|
*/
|
|
|
|
|
string static_address = 1;
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
/*
|
|
|
|
|
The CSV expiry of the static address.
|
|
|
|
|
*/
|
|
|
|
|
uint64 relative_expiry_blocks = 2;
|
|
|
|
|
|
2024-06-05 13:33:47 +02:00
|
|
|
/*
|
|
|
|
|
The total number of deposits.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
uint32 total_num_deposits = 3;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of unconfirmed deposits.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_unconfirmed_satoshis = 4;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of confirmed deposits.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_deposited_satoshis = 5;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of all expired deposits.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_expired_satoshis = 6;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of all deposits that have been withdrawn.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_withdrawn_satoshis = 7;
|
2024-11-19 13:15:53 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of all loop-ins that have been finalized.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_looped_in_satoshis = 8;
|
2024-11-19 13:15:53 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of all htlc timeout sweeps that the client swept.
|
|
|
|
|
*/
|
2024-11-05 10:15:10 +01:00
|
|
|
int64 value_htlc_timeout_sweeps_satoshis = 9;
|
2025-05-21 14:08:54 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The total value of all deposits that have been used for channel openings.
|
|
|
|
|
*/
|
|
|
|
|
int64 value_channels_opened = 10;
|
2024-06-05 13:33:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2024-11-19 13:15:53 +01:00
|
|
|
/*
|
|
|
|
|
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;
|
|
|
|
|
|
2024-06-05 13:33:47 +02:00
|
|
|
/*
|
|
|
|
|
PUBLISH_EXPIRED indicates that the deposit has expired and the sweep
|
|
|
|
|
transaction has been published.
|
|
|
|
|
*/
|
2024-11-19 13:15:53 +01:00
|
|
|
PUBLISH_EXPIRED = 8;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep
|
|
|
|
|
transaction has not yet been sufficiently confirmed.
|
|
|
|
|
*/
|
2024-11-19 13:15:53 +01:00
|
|
|
WAIT_FOR_EXPIRY_SWEEP = 9;
|
2024-06-05 13:33:47 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
EXPIRED indicates that the deposit has expired and the sweep transaction
|
|
|
|
|
has been sufficiently confirmed.
|
|
|
|
|
*/
|
2024-11-19 13:15:53 +01:00
|
|
|
EXPIRED = 10;
|
2025-05-21 14:08:54 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
OPENING_CHANNEL indicates that the channel open in which the deposit was
|
|
|
|
|
used is in progress.
|
|
|
|
|
*/
|
|
|
|
|
OPENING_CHANNEL = 11;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
CHANNEL_PUBLISHED indicates that the channel open was finalized and
|
|
|
|
|
published and that it should be managed from lnd from now on.
|
|
|
|
|
*/
|
|
|
|
|
CHANNEL_PUBLISHED = 12;
|
2024-06-05 13:33:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The block height at which the deposit was confirmed.
|
|
|
|
|
*/
|
|
|
|
|
int64 confirmation_height = 5;
|
2024-11-05 10:15:10 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The number of blocks that are left until the deposit cannot be used for a
|
|
|
|
|
loop-in swap anymore.
|
|
|
|
|
*/
|
|
|
|
|
int64 blocks_until_expiry = 6;
|
2025-08-12 12:56:11 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The swap hash of the swap that this deposit is part of. This field is only
|
|
|
|
|
set if the deposit is part of a loop-in swap.
|
|
|
|
|
*/
|
|
|
|
|
bytes swap_hash = 7;
|
2024-11-05 10:15:10 +01:00
|
|
|
}
|
|
|
|
|
|
2025-05-13 11:34:02 +02:00
|
|
|
message StaticAddressWithdrawal {
|
|
|
|
|
/*
|
|
|
|
|
The transaction id of the withdrawal transaction.
|
|
|
|
|
*/
|
|
|
|
|
string tx_id = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The selected deposits that is withdrawn from.
|
|
|
|
|
*/
|
|
|
|
|
repeated Deposit deposits = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The sum of the deposit values that was selected for withdrawal.
|
|
|
|
|
*/
|
|
|
|
|
int64 total_deposit_amount_satoshis = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The actual amount that was withdrawn from the selected deposits. This value
|
|
|
|
|
represents the sum of selected deposit values minus tx fees minus optional
|
|
|
|
|
change output.
|
|
|
|
|
*/
|
|
|
|
|
int64 withdrawn_amount_satoshis = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An optional change.
|
|
|
|
|
*/
|
|
|
|
|
int64 change_amount_satoshis = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The confirmation block height of the withdrawal transaction.
|
|
|
|
|
*/
|
|
|
|
|
uint32 confirmation_height = 6;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 10:15:10 +01:00
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The invoiced swap amount. It is the swap amount minus the quoted server
|
|
|
|
|
fees.
|
|
|
|
|
*/
|
|
|
|
|
int64 payment_request_amount_satoshis = 5;
|
2025-08-12 13:45:51 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The deposits that were used for this swap.
|
|
|
|
|
*/
|
|
|
|
|
repeated Deposit deposits = 6;
|
2026-05-29 15:32:31 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Initiation time of the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 initiation_time = 7;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Last update time of the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 last_update_time = 8;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Swap server cost.
|
|
|
|
|
*/
|
|
|
|
|
int64 cost_server = 9;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
On-chain transaction cost.
|
|
|
|
|
*/
|
|
|
|
|
int64 cost_onchain = 10;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Off-chain routing fees.
|
|
|
|
|
*/
|
|
|
|
|
int64 cost_offchain = 11;
|
2024-11-05 10:15:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
2024-11-14 15:34:17 +01:00
|
|
|
SUCCEEDED = 8;
|
2024-11-05 10:15:10 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
2024-11-14 15:34:17 +01:00
|
|
|
SUCCEEDED_TRANSITIONING_FAILED = 9;
|
2024-11-05 10:15:10 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
2024-11-14 15:34:17 +01:00
|
|
|
UNLOCK_DEPOSITS = 10;
|
2024-11-05 10:15:10 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
2024-11-14 15:34:17 +01:00
|
|
|
FAILED_STATIC_ADDRESS_SWAP = 11;
|
2024-06-05 13:33:47 +02:00
|
|
|
}
|
2024-11-19 13:15:53 +01:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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;
|
2025-02-20 15:40:58 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The optional swap amount the client is attempting to swap. It can be
|
|
|
|
|
provided in combination with the outpoints or separately. If provided with
|
|
|
|
|
outpoints the client takes out this amount from the sum of provided
|
|
|
|
|
outpoints and sends the change back to the static address. If the amount is
|
|
|
|
|
provided without outpoints, the client will select deposits automatically.
|
|
|
|
|
The coin selection strategy is simplified by sorting all available deposits
|
|
|
|
|
in descending order by amount, and equal amounts in ascending order of
|
|
|
|
|
blocks until expiry, and then selecting the largest deposits first until the
|
|
|
|
|
amount is reached. The change will be sent back to the static address. If a
|
|
|
|
|
subset of outpoints suffice to cover the specified amount the swap will be
|
|
|
|
|
canceled to allow the user to safe on transaction fees.
|
|
|
|
|
*/
|
|
|
|
|
int64 amount = 9;
|
2025-10-01 08:39:38 +02:00
|
|
|
|
|
|
|
|
// If set, request the server to use fast publication behavior.
|
|
|
|
|
bool fast = 10;
|
2024-11-19 13:15:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The htlc cltv expiry height of the swap.
|
|
|
|
|
*/
|
|
|
|
|
int32 htlc_cltv = 4;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The quoted swap fee in satoshis.
|
|
|
|
|
*/
|
|
|
|
|
int64 quoted_swap_fee_satoshis = 5;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The maximum total swap fee the client is willing to pay for the swap.
|
|
|
|
|
*/
|
|
|
|
|
int64 max_swap_fee_satoshis = 6;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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;
|
2025-10-08 21:13:20 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The deposits that are used for this swap.
|
|
|
|
|
*/
|
|
|
|
|
repeated Deposit used_deposits = 12;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The amount that is being swapped (may be less than total deposit value if
|
|
|
|
|
change is returned).
|
|
|
|
|
*/
|
|
|
|
|
uint64 swap_amount = 13;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The change amount that will be returned to the static address.
|
|
|
|
|
*/
|
|
|
|
|
int64 change = 14;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
If set, indicates that the server was requested to use fast publication
|
|
|
|
|
behavior.
|
|
|
|
|
*/
|
|
|
|
|
bool fast = 15;
|
2024-11-19 13:15:53 +01:00
|
|
|
}
|
2025-01-09 16:22:28 +01:00
|
|
|
|
|
|
|
|
message AssetLoopOutRequest {
|
|
|
|
|
/*
|
|
|
|
|
The asset id to use to pay for the swap invoice. If set an
|
|
|
|
|
asset client is needed to set to be able to pay the invoice.
|
|
|
|
|
*/
|
|
|
|
|
bytes asset_id = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The node identity public key of the peer to ask for a quote for sending out
|
|
|
|
|
the assets and converting them to satoshis. This must be specified if
|
|
|
|
|
an asset id is set.
|
|
|
|
|
*/
|
|
|
|
|
bytes asset_edge_node = 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An optional maximum multiplier for the rfq rate. If not set, the default
|
|
|
|
|
will be 1.1. This means if we request a loop out quote for 1 BTC, the off
|
|
|
|
|
chain cost will be at most 1.1 BTC.
|
|
|
|
|
*/
|
|
|
|
|
double max_limit_multiplier = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
An optional expiry unix timestamp for when the rfq quote should expire.
|
|
|
|
|
*/
|
|
|
|
|
int64 expiry = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message AssetRfqInfo {
|
|
|
|
|
/*
|
|
|
|
|
The Prepay RFQ ID to use to pay for the prepay invoice.
|
|
|
|
|
*/
|
|
|
|
|
bytes prepay_rfq_id = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
2025-01-22 09:59:03 +01:00
|
|
|
The maximum asset amt we'll pay for the prepay payment. This includes the
|
|
|
|
|
max limit multiplier that was set in the request.
|
2025-01-09 16:22:28 +01:00
|
|
|
*/
|
2025-01-22 09:59:03 +01:00
|
|
|
uint64 max_prepay_asset_amt = 2;
|
2025-01-09 16:22:28 +01:00
|
|
|
|
2025-01-22 09:59:52 +01:00
|
|
|
/*
|
|
|
|
|
The asset to BTC conversion rate for the prepay invoice.
|
|
|
|
|
*/
|
|
|
|
|
FixedPoint prepay_asset_rate = 6;
|
|
|
|
|
|
2025-01-09 16:22:28 +01:00
|
|
|
/*
|
|
|
|
|
The Swap RFQ ID to use to pay for the swap invoice.
|
|
|
|
|
*/
|
|
|
|
|
bytes swap_rfq_id = 3;
|
|
|
|
|
|
|
|
|
|
/*
|
2025-01-22 09:59:03 +01:00
|
|
|
The maximum asset amt we'll pay for the swap payment. This includes the
|
|
|
|
|
max limit multiplier that was set in the request.
|
2025-01-09 16:22:28 +01:00
|
|
|
*/
|
2025-01-22 09:59:03 +01:00
|
|
|
uint64 max_swap_asset_amt = 4;
|
2025-01-09 16:22:28 +01:00
|
|
|
|
2025-01-22 09:59:52 +01:00
|
|
|
/*
|
|
|
|
|
The asset to BTC conversion rate for the swap invoice.
|
|
|
|
|
*/
|
|
|
|
|
FixedPoint swap_asset_rate = 7;
|
|
|
|
|
|
2025-01-09 16:22:28 +01:00
|
|
|
/*
|
|
|
|
|
The name of the asset to swap.
|
|
|
|
|
*/
|
|
|
|
|
string asset_name = 5;
|
|
|
|
|
}
|
2025-01-20 09:16:07 +01:00
|
|
|
|
2025-01-22 09:59:52 +01:00
|
|
|
// FixedPoint is a scaled integer representation of a fractional number.
|
|
|
|
|
//
|
|
|
|
|
// This type consists of two integer fields: a coefficient and a scale.
|
|
|
|
|
// Using this format enables precise and consistent representation of fractional
|
|
|
|
|
// numbers while avoiding floating-point data types, which are prone to
|
|
|
|
|
// precision errors.
|
|
|
|
|
//
|
|
|
|
|
// The relationship between the fractional representation and its fixed-point
|
|
|
|
|
// representation is expressed as:
|
|
|
|
|
// ```
|
|
|
|
|
// V = F_c / (10^F_s)
|
|
|
|
|
// ```
|
|
|
|
|
// where:
|
|
|
|
|
//
|
|
|
|
|
// * `V` is the fractional value.
|
|
|
|
|
//
|
|
|
|
|
// * `F_c` is the coefficient component of the fixed-point representation. It is
|
|
|
|
|
// the scaled-up fractional value represented as an integer.
|
|
|
|
|
//
|
|
|
|
|
// * `F_s` is the scale component. It is an integer specifying how
|
|
|
|
|
// many decimal places `F_c` should be divided by to obtain the fractional
|
|
|
|
|
// representation.
|
|
|
|
|
message FixedPoint {
|
|
|
|
|
// The coefficient is the fractional value scaled-up as an integer. This
|
|
|
|
|
// integer is represented as a string as it may be too large to fit in a
|
|
|
|
|
// uint64.
|
|
|
|
|
string coefficient = 1;
|
|
|
|
|
|
|
|
|
|
// The scale is the component that determines how many decimal places
|
|
|
|
|
// the coefficient should be divided by to obtain the fractional value.
|
|
|
|
|
uint32 scale = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-20 09:16:07 +01:00
|
|
|
message AssetLoopOutInfo {
|
|
|
|
|
/*
|
|
|
|
|
The asset id that was used to pay for the swap invoice.
|
|
|
|
|
*/
|
|
|
|
|
string asset_id = 1;
|
|
|
|
|
/*
|
|
|
|
|
The human readable name of the asset.
|
|
|
|
|
*/
|
|
|
|
|
string asset_name = 2;
|
|
|
|
|
/*
|
|
|
|
|
The total asset offchain cost of the swap.
|
|
|
|
|
*/
|
|
|
|
|
uint64 asset_cost_offchain = 3;
|
|
|
|
|
}
|