2019-03-06 20:13:50 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2019-03-12 22:34:45 +00:00
|
|
|
import "google/api/annotations.proto";
|
|
|
|
|
2019-03-06 23:53:17 +00:00
|
|
|
package looprpc;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
2019-03-07 02:24:29 +00: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 {
|
2019-03-12 22:34:45 +00:00
|
|
|
/** loop: `out`
|
2019-03-07 02:24:29 +00: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().
|
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc LoopOut (LoopOutRequest) returns (SwapResponse) {
|
2019-03-12 22:34:45 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
post: "/v1/loop/out"
|
|
|
|
body: "*"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `in`
|
2019-03-12 15:10:37 +00: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().
|
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc LoopIn (LoopInRequest) returns (SwapResponse) {
|
2019-09-05 03:48:48 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
post: "/v1/loop/in"
|
|
|
|
body: "*"
|
|
|
|
};
|
|
|
|
}
|
2019-03-12 15:10:37 +00:00
|
|
|
|
2019-03-12 22:34:45 +00:00
|
|
|
/** loop: `monitor`
|
2019-03-07 02:24:29 +00:00
|
|
|
Monitor will return a stream of swap updates for currently active swaps.
|
|
|
|
*/
|
2020-01-31 12:57:22 +00:00
|
|
|
rpc Monitor (MonitorRequest) returns (stream SwapStatus) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/monitor"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `listswaps`
|
2020-01-31 12:57:22 +00:00
|
|
|
ListSwaps returns a list of all currently known swaps and their current
|
|
|
|
status.
|
|
|
|
*/
|
|
|
|
rpc ListSwaps (ListSwapsRequest) returns (ListSwapsResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/swaps"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `swapinfo`
|
2020-01-31 12:57:22 +00:00
|
|
|
SwapInfo returns all known details about a single swap.
|
|
|
|
*/
|
|
|
|
rpc SwapInfo (SwapInfoRequest) returns (SwapStatus) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/swap/{id}"
|
|
|
|
};
|
|
|
|
}
|
2019-03-07 02:24:29 +00:00
|
|
|
|
2019-03-12 22:34:45 +00:00
|
|
|
/** loop: `terms`
|
|
|
|
LoopOutTerms returns the terms that the server enforces for a loop out swap.
|
2019-03-07 02:24:29 +00:00
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc LoopOutTerms (TermsRequest) returns (TermsResponse) {
|
2019-03-12 22:34:45 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/out/terms"
|
|
|
|
};
|
|
|
|
}
|
2019-03-07 02:24:29 +00:00
|
|
|
|
2019-03-12 22:34:45 +00:00
|
|
|
/** loop: `quote`
|
|
|
|
LoopOutQuote returns a quote for a loop out swap with the provided
|
|
|
|
parameters.
|
2019-03-07 02:24:29 +00:00
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc LoopOutQuote (QuoteRequest) returns (QuoteResponse) {
|
2019-03-12 22:34:45 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/out/quote/{amt}"
|
|
|
|
};
|
|
|
|
}
|
2019-03-12 15:10:37 +00:00
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `terms`
|
2019-03-12 15:10:37 +00:00
|
|
|
GetTerms returns the terms that the server enforces for swaps.
|
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc GetLoopInTerms (TermsRequest) returns (TermsResponse) {
|
2019-09-05 03:48:48 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/in/terms"
|
|
|
|
};
|
|
|
|
}
|
2019-03-12 15:10:37 +00:00
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `quote`
|
2019-03-12 15:10:37 +00:00
|
|
|
GetQuote returns a quote for a swap with the provided parameters.
|
|
|
|
*/
|
2019-11-15 12:57:03 +00:00
|
|
|
rpc GetLoopInQuote (QuoteRequest) returns (QuoteResponse) {
|
2019-09-05 03:48:48 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/loop/in/quote/{amt}"
|
|
|
|
};
|
|
|
|
}
|
2019-11-15 12:57:03 +00:00
|
|
|
|
2020-02-05 02:42:32 +00:00
|
|
|
/** loop: `listauth`
|
2019-11-15 12:57:03 +00:00
|
|
|
GetLsatTokens returns all LSAT tokens the daemon ever paid for.
|
|
|
|
*/
|
|
|
|
rpc GetLsatTokens (TokensRequest) returns (TokensResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/lsat/tokens"
|
|
|
|
};
|
|
|
|
}
|
2019-03-07 02:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message LoopOutRequest {
|
|
|
|
/**
|
|
|
|
Requested swap amount in sat. This does not include the swap and miner fee.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Base58 encoded destination address for the swap.
|
|
|
|
*/
|
|
|
|
string dest = 2;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Maximum off-chain fee in msat that may be paid for 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-07 02:24:29 +00:00
|
|
|
int64 max_swap_routing_fee = 3;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
2019-03-07 02:24:29 +00:00
|
|
|
Maximum off-chain fee in msat that may be paid for 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 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
int64 max_prepay_routing_fee = 4;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
2019-03-07 02:24:29 +00: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 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
int64 max_swap_fee = 5;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
2019-03-07 02:24:29 +00:00
|
|
|
Maximum amount of the swap fee that may be charged as a prepayment.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
int64 max_prepay_amt = 6;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
2019-03-07 02:24:29 +00:00
|
|
|
Maximum in on-chain fees that we are willing to spent. If we want to
|
|
|
|
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 22:34:45 +00:00
|
|
|
|
2019-03-07 02:24:29 +00: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 22:34:45 +00:00
|
|
|
|
2019-03-07 02:24:29 +00:00
|
|
|
max_miner_fee is typically taken from the response of the GetQuote call.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
|
|
|
int64 max_miner_fee = 7;
|
2019-03-12 22:34:45 +00:00
|
|
|
|
2019-03-06 20:13:50 +00:00
|
|
|
/**
|
2019-03-07 02:24:29 +00:00
|
|
|
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 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
uint64 loop_out_channel = 8;
|
2019-06-25 18:41:49 +00: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 09:35:32 +00: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;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
2019-03-12 15:10:37 +00:00
|
|
|
message LoopInRequest {
|
|
|
|
/**
|
|
|
|
Requested swap amount in sat. This does not include the swap and miner
|
|
|
|
fee.
|
|
|
|
*/
|
|
|
|
int64 amt = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Maximum in on-chain fees that we are willing to spent. If we want to
|
|
|
|
publish the on-chain htlc and the fee estimate turns out higher than this
|
|
|
|
value, we cancel the swap.
|
|
|
|
|
|
|
|
max_miner_fee is typically taken from the response of the GetQuote call.
|
|
|
|
*/
|
|
|
|
int64 max_miner_fee = 3;
|
2019-11-15 12:57:03 +00:00
|
|
|
|
2019-03-12 15:10:37 +00:00
|
|
|
/**
|
|
|
|
The channel to loop in. If zero, the channel to loop in is selected based
|
|
|
|
on the lowest routing fee for the swap payment from the server.
|
2019-04-02 07:21:53 +00:00
|
|
|
|
|
|
|
Note: NOT YET IMPLEMENTED
|
2019-03-12 15:10:37 +00:00
|
|
|
*/
|
|
|
|
uint64 loop_in_channel = 4;
|
2019-03-28 12:29:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
If external_htlc is true, we expect the htlc to be published by an external
|
|
|
|
actor.
|
|
|
|
*/
|
|
|
|
bool external_htlc = 5;
|
2019-03-12 15:10:37 +00:00
|
|
|
}
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
message SwapResponse {
|
|
|
|
/**
|
|
|
|
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 12:57:28 +00: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 20:13:50 +00:00
|
|
|
*/
|
2020-01-31 12:57:28 +00:00
|
|
|
string id = 1 [deprecated = true];
|
|
|
|
|
|
|
|
/**
|
|
|
|
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 12:29:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
The address of the on-chain htlc.
|
|
|
|
*/
|
|
|
|
string htlc_address = 2;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
2019-11-15 12:57:03 +00:00
|
|
|
message MonitorRequest {
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SwapStatus {
|
|
|
|
/**
|
2019-03-12 22:34:45 +00:00
|
|
|
Requested swap amount in sat. This does not include the swap and miner
|
2019-03-06 20:13:50 +00:00
|
|
|
fee.
|
|
|
|
*/
|
|
|
|
int64 amt = 1;
|
|
|
|
|
2020-01-31 12:57:28 +00: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];
|
|
|
|
|
2019-03-06 20:13:50 +00: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 12:57:28 +00:00
|
|
|
bytes id_bytes = 11;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Swap type
|
|
|
|
*/
|
|
|
|
SwapType type = 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
State the swap is currently in, see State enum.
|
|
|
|
*/
|
|
|
|
SwapState state = 4;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Initiation time of the swap.
|
|
|
|
*/
|
|
|
|
int64 initiation_time = 5;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Initiation time of the swap.
|
|
|
|
*/
|
|
|
|
int64 last_update_time = 6;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Htlc address.
|
|
|
|
*/
|
|
|
|
string htlc_address = 7;
|
2019-05-15 12:02:29 +00:00
|
|
|
|
|
|
|
/// Swap server cost
|
|
|
|
int64 cost_server = 8;
|
|
|
|
|
|
|
|
// On-chain transaction cost
|
|
|
|
int64 cost_onchain = 9;
|
|
|
|
|
|
|
|
// Off-chain routing fees
|
|
|
|
int64 cost_offchain = 10;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
2019-03-12 22:34:45 +00:00
|
|
|
enum SwapType {
|
2019-03-07 02:24:29 +00:00
|
|
|
// LOOP_OUT indicates an loop out swap (off-chain to on-chain)
|
|
|
|
LOOP_OUT = 0;
|
2019-03-12 15:10:37 +00:00
|
|
|
|
|
|
|
// LOOP_IN indicates a loop in swap (on-chain to off-chain)
|
|
|
|
LOOP_IN = 1;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum SwapState {
|
|
|
|
/**
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
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;
|
|
|
|
|
2019-03-12 15:10:37 +00:00
|
|
|
/**
|
|
|
|
HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in
|
|
|
|
swap.
|
|
|
|
*/
|
|
|
|
HTLC_PUBLISHED = 2;
|
|
|
|
|
2019-03-06 20:13:50 +00:00
|
|
|
/**
|
|
|
|
SUCCESS is the final swap state that is reached when the sweep tx has
|
|
|
|
the required confirmation depth.
|
|
|
|
*/
|
|
|
|
SUCCESS = 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
FAILED is the final swap state for a failed swap with or without loss of
|
|
|
|
the swap amount.
|
|
|
|
*/
|
|
|
|
FAILED = 4;
|
2019-04-02 08:51:51 +00:00
|
|
|
|
2019-11-15 12:57:03 +00: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 08:51:51 +00:00
|
|
|
INVOICE_SETTLED = 5;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
2020-01-31 12:57:22 +00:00
|
|
|
message ListSwapsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListSwapsResponse {
|
|
|
|
/**
|
|
|
|
The list of all currently known swaps and their status.
|
|
|
|
*/
|
|
|
|
repeated SwapStatus swaps = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SwapInfoRequest {
|
|
|
|
/**
|
|
|
|
The swap identifier which currently is the hash that locks the HTLCs. When
|
|
|
|
using REST, this field must be encoded as base64.
|
|
|
|
*/
|
|
|
|
bytes id = 1;
|
|
|
|
}
|
|
|
|
|
2019-03-06 20:13:50 +00:00
|
|
|
message TermsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message TermsResponse {
|
|
|
|
|
2019-11-15 12:57:03 +00:00
|
|
|
reserved 1, 2, 3, 4, 7;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Minimum swap amount (sat)
|
|
|
|
*/
|
|
|
|
int64 min_swap_amount = 5;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Maximum swap amount (sat)
|
|
|
|
*/
|
|
|
|
int64 max_swap_amount = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message QuoteRequest {
|
|
|
|
/**
|
2019-03-12 22:34:45 +00:00
|
|
|
The amount to swap in satoshis.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
|
|
|
int64 amt = 1;
|
2019-06-25 18:41:45 +00: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 07:58:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
If external_htlc is true, we expect the htlc to be published by an external
|
|
|
|
actor.
|
|
|
|
*/
|
|
|
|
bool external_htlc = 3;
|
2020-01-07 12:43:39 +00: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 = 4;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message QuoteResponse {
|
|
|
|
/**
|
|
|
|
The fee that the swap server is charging for the swap.
|
|
|
|
*/
|
|
|
|
int64 swap_fee = 1;
|
|
|
|
|
|
|
|
/**
|
2019-03-12 22:34:45 +00:00
|
|
|
The part of the swap fee that is requested as a prepayment.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
int64 prepay_amt = 2;
|
2019-03-06 20:13:50 +00:00
|
|
|
|
|
|
|
/**
|
2019-03-12 22:34:45 +00:00
|
|
|
An estimate of the on-chain fee that needs to be paid to sweep the HTLC.
|
2019-03-06 20:13:50 +00:00
|
|
|
*/
|
2019-03-07 02:24:29 +00:00
|
|
|
int64 miner_fee = 3;
|
2019-10-08 20:28:20 +00: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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
On-chain cltv expiry delta
|
|
|
|
*/
|
|
|
|
int32 cltv_delta = 5;
|
2019-03-06 20:13:50 +00:00
|
|
|
}
|
2019-11-15 12:57:03 +00:00
|
|
|
|
|
|
|
message TokensRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message TokensResponse {
|
|
|
|
/**
|
|
|
|
List of all tokens the daemon knows of, including old/expired tokens.
|
|
|
|
*/
|
|
|
|
repeated LsatToken tokens = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LsatToken {
|
|
|
|
/**
|
|
|
|
The base macaroon that was baked by the auth server.
|
|
|
|
*/
|
|
|
|
bytes base_macaroon = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The payment hash of the payment that was paid to obtain the token.
|
|
|
|
*/
|
|
|
|
bytes payment_hash = 2;
|
|
|
|
|
|
|
|
/**
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The amount of millisatoshis that was paid to get the token.
|
|
|
|
*/
|
|
|
|
int64 amount_paid_msat = 4;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The amount of millisatoshis paid in routing fee to pay for the token.
|
|
|
|
*/
|
|
|
|
int64 routing_fee_paid_msat = 5;
|
|
|
|
|
|
|
|
/**
|
|
|
|
The creation time of the token as UNIX timestamp in seconds.
|
|
|
|
*/
|
|
|
|
int64 time_created = 6;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Indicates whether the token is expired or still valid.
|
|
|
|
*/
|
|
|
|
bool expired = 7;
|
2020-01-31 12:57:22 +00:00
|
|
|
|
2019-11-15 12:57:03 +00: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;
|
|
|
|
}
|