liquidity-ad: request amount, pass through to dualopend

Changelog-Experimental: EXPERIMENTAL-DUAL-FUND: JSON-RPC: openchannel_init now takes a `requested_amt`, which is an amount to request from peer
This commit is contained in:
niftynei
2021-06-08 16:50:41 -05:00
committed by neil saitug
parent f1b7e5fffe
commit e41d2dc0e6
8 changed files with 131 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
lightning-openchannel_init - Command to initiate a channel to a peer
.SH SYNOPSIS
\fBopenchannel_init\fR \fIid\fR \fIamount\fR \fIinitalpsbt\fR [\fIcommitment_feerate\fR] [\fIfunding_feerate\fR] [\fIannounce\fR] [\fIclose_to\fR]
\fBopenchannel_init\fR \fIid\fR \fIamount\fR \fIinitalpsbt\fR [\fIcommitment_feerate\fR] [\fIfunding_feerate\fR] [\fIannounce\fR] [\fIclose_to\fR] [\fIrequest_amt\fR]
.SH DESCRIPTION
@@ -43,6 +43,11 @@ funding transaction\. Defaults to 'opening' feerate\.
sent on close\. Only valid if both peers have negotiated
\fBoption_upfront_shutdown_script\fR\.
\fIrequest_amt\fR is an amount of liquidity you'd like to lease from the peer\.
If peer supports \fBoption_will_fund\fR, indicates to them to include this
much liquidity into the channel\.
.SH RETURN VALUE
On success, an object is returned, containing:
@@ -63,6 +68,15 @@ If the peer does not support \fBoption_dual_fund\fR, this command
will return an error\.
If you sent a \fIrequest_amt\fR and the peer supports \fBoption_will_fund\fR and is
interested in leasing you liquidity in this channel, returns their updated
channel fee max (\fIchannel_fee_proportional_basis\fR, \fIchannel_fee_base_msat\fR),
updated rate card for the lease fee (\fIlease_fee_proportional_basis\fR,
\fIlease_fee_base_sat\fR) and their on-chain weight \fIweight_charge\fR, which will
be added to the lease fee at a rate of \fIfunding_feerate\fR \fI \fRweight_charge*
/ 1000\.
On error the returned object will contain \fBcode\fR and \fBmessage\fR properties,
with \fBcode\fR being one of the following:
@@ -105,4 +119,4 @@ lightning-fundchannel_\fBcomplete\fR(7), \fBlightning-fundchannel\fR(7),
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:ba03cf64c3578303a0cdfcf94546bb94d86ecf3d6187b16871a39c08b3a40f38
\" SHA256STAMP:13023bb80ee4a7f6a94a168399a01e05c6c5ab68e9eec5795ebd5f49207a03ac

View File

@@ -4,7 +4,7 @@ lightning-openchannel\_init -- Command to initiate a channel to a peer
SYNOPSIS
--------
**openchannel_init** *id* *amount* *initalpsbt* \[*commitment_feerate*\] \[*funding_feerate*\] \[*announce*\] \[*close_to*\]
**openchannel_init** *id* *amount* *initalpsbt* \[*commitment_feerate*\] \[*funding_feerate*\] \[*announce*\] \[*close_to*\] \[*request_amt*\]
DESCRIPTION
-----------
@@ -38,6 +38,10 @@ funding transaction. Defaults to 'opening' feerate.
sent on close. Only valid if both peers have negotiated
`option_upfront_shutdown_script`.
*request_amt* is an amount of liquidity you'd like to lease from the peer.
If peer supports `option_will_fund`, indicates to them to include this
much liquidity into the channel.
RETURN VALUE
------------
@@ -53,6 +57,14 @@ On success, an object is returned, containing:
If the peer does not support `option_dual_fund`, this command
will return an error.
If you sent a *request_amt* and the peer supports `option_will_fund` and is
interested in leasing you liquidity in this channel, returns their updated
channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*),
updated rate card for the lease fee (*lease_fee_proportional_basis*,
*lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will
be added to the lease fee at a rate of *funding_feerate* * *weight_charge*
/ 1000.
On error the returned object will contain `code` and `message` properties,
with `code` being one of the following: