From f5fbf6655da2b7e90a43f5b06b3d44c43f77941f Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 21 Feb 2020 09:55:52 +0100 Subject: [PATCH] looprpc: clarify loop quote response --- looprpc/client.pb.go | 10 ++++++++-- looprpc/client.proto | 10 ++++++++-- looprpc/client.swagger.json | 6 +++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 304fdab..496f9fa 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -813,7 +813,7 @@ type QuoteRequest struct { //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. + //lower total swap fee. This only has an effect on loop out quotes. SwapPublicationDeadline uint64 `protobuf:"varint,4,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -881,7 +881,13 @@ type QuoteResponse struct { //The part of the swap fee that is requested as a prepayment. PrepayAmt int64 `protobuf:"varint,2,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"` //* - //An estimate of the on-chain fee that needs to be paid to sweep the HTLC. + //An estimate of the on-chain fee that needs to be paid to sweep the HTLC for + //a loop out or to pay to the HTLC for loop in. 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. MinerFee int64 `protobuf:"varint,3,opt,name=miner_fee,json=minerFee,proto3" json:"miner_fee,omitempty"` //* //The node pubkey where the swap payment needs to be paid diff --git a/looprpc/client.proto b/looprpc/client.proto index a246eb5..f7e53e8 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -412,7 +412,7 @@ message QuoteRequest { 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. + lower total swap fee. This only has an effect on loop out quotes. */ uint64 swap_publication_deadline = 4; } @@ -429,7 +429,13 @@ message QuoteResponse { int64 prepay_amt = 2; /** - An estimate of the on-chain fee that needs to be paid to sweep the HTLC. + An estimate of the on-chain fee that needs to be paid to sweep the HTLC for + a loop out or to pay to the HTLC for loop in. 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 miner_fee = 3; diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index faa12b6..b711ae1 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -81,7 +81,7 @@ }, { "name": "swap_publication_deadline", - "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee.", + "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.", "in": "query", "required": false, "type": "string", @@ -176,7 +176,7 @@ }, { "name": "swap_publication_deadline", - "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee.", + "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee. This only has an effect on loop out quotes.", "in": "query", "required": false, "type": "string", @@ -424,7 +424,7 @@ "miner_fee": { "type": "string", "format": "int64", - "description": "*\nAn estimate of the on-chain fee that needs to be paid to sweep the HTLC." + "description": "*\nAn estimate of the on-chain fee that needs to be paid to sweep the HTLC for\na loop out or to pay to the HTLC for loop in. If a miner fee of 0 is\nreturned, it means the external_htlc flag was set for a loop in and the fee\nestimation was skipped. If a miner fee of -1 is returned, it means lnd's\nwallet tried to estimate the fee but was unable to create a sample\nestimation transaction because not enough funds are available. An\ninformation message should be shown to the user in this case." }, "swap_payment_dest": { "type": "string",