mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 02:27:51 +01:00
2ddecdc95a
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: doc: Epic documentation rewrite: each now lists complete and accurate JSON output, tested against testsuite.
101 lines
3.2 KiB
Groff
Generated
101 lines
3.2 KiB
Groff
Generated
.TH "LIGHTNING-TXPREPARE" "7" "" "" "lightning-txprepare"
|
||
.SH NAME
|
||
lightning-txprepare - Command to prepare to withdraw funds from the internal wallet
|
||
.SH SYNOPSIS
|
||
|
||
\fBtxprepare\fR \fIoutputs\fR [\fIfeerate\fR] [\fIminconf\fR] [\fIutxos\fR]
|
||
|
||
.SH DESCRIPTION
|
||
|
||
The \fBtxprepare\fR RPC command creates an unsigned transaction which
|
||
spends funds from c-lightning’s internal wallet to the outputs specified
|
||
in \fIoutputs\fR\.
|
||
|
||
|
||
The \fIoutputs\fR is the array of output that include \fIdestination\fR
|
||
and \fIamount\fR({\fIdestination\fR: \fIamount\fR})\. Its format is like:
|
||
[{address1: amount1}, {address2: amount2}]
|
||
or
|
||
[{address: \fIall\fR}]\.
|
||
It supports any number of \fBconfirmed\fR outputs\.
|
||
|
||
|
||
The \fIdestination\fR of output is the address which can be of any Bitcoin accepted
|
||
type, including bech32\.
|
||
|
||
|
||
The \fIamount\fR of output is the amount to be sent from the internal wallet
|
||
(expressed, as name suggests, in amount)\. The string \fIall\fR can be used to specify
|
||
all available funds\. Otherwise, it is in amount precision; it can be a whole
|
||
number, a whole number ending in \fIsat\fR, a whole number ending in \fI000msat\fR,
|
||
or a number with 1 to 8 decimal places ending in \fIbtc\fR\.
|
||
|
||
|
||
\fIfeerate\fR is an optional feerate to use\. It can be one of the strings
|
||
\fIurgent\fR (aim for next block), \fInormal\fR (next 4 blocks or so) or \fIslow\fR
|
||
(next 100 blocks or so) to use lightningd’s internal estimates: \fInormal\fR
|
||
is the default\.
|
||
|
||
|
||
Otherwise, \fIfeerate\fR is a number, with an optional suffix: \fIperkw\fR means
|
||
the number is interpreted as satoshi-per-kilosipa (weight), and \fIperkb\fR
|
||
means it is interpreted bitcoind-style as satoshi-per-kilobyte\. Omitting
|
||
the suffix is equivalent to \fIperkb\fR\.
|
||
|
||
|
||
\fIminconf\fR specifies the minimum number of confirmations that used
|
||
outputs should have\. Default is 1\.
|
||
|
||
|
||
\fIutxos\fR specifies the utxos to be used to fund the transaction, as an array
|
||
of "txid:vout"\. These must be drawn from the node's available UTXO set\.
|
||
|
||
|
||
\fBtxprepare\fR is similar to the first part of a \fBwithdraw\fR command, but
|
||
supports multiple outputs and uses \fIoutputs\fR as parameter\. The second part
|
||
is provided by \fBtxsend\fR\.
|
||
|
||
.SH RETURN VALUE
|
||
|
||
On success, an object is returned, containing:
|
||
|
||
.RS
|
||
.IP \[bu]
|
||
\fBpsbt\fR (string): the PSBT representing the unsigned transaction
|
||
.IP \[bu]
|
||
\fBunsigned_tx\fR (hex): the unsigned transaction
|
||
.IP \[bu]
|
||
\fBtxid\fR (txid): the transaction id of \fIunsigned_tx\fR; you hand this to \fBlightning-txsend\fR(7) or \fBlightning-txdiscard\fR(7), as the inputs of this transaction are reserved\.
|
||
|
||
.RE
|
||
|
||
On failure, an error is reported and the transaction is not created\.
|
||
|
||
|
||
The following error codes may occur:
|
||
|
||
.RS
|
||
.IP \[bu]
|
||
-1: Catchall nonspecific error\.
|
||
.IP \[bu]
|
||
301: There are not enough funds in the internal wallet (including
|
||
fees) to create the transaction\.
|
||
.IP \[bu]
|
||
302: The dust limit is not met\.
|
||
|
||
.RE
|
||
.SH AUTHOR
|
||
|
||
Rusty Russell \fI<rusty@rustcorp.com.au\fR> is mainly responsible\.
|
||
|
||
.SH SEE ALSO
|
||
|
||
\fBlightning-withdraw\fR(7), \fBlightning-txsend\fR(7), \fBlightning-txdiscard\fR(7),
|
||
\fBlightning-feerates\fR(7)
|
||
|
||
.SH RESOURCES
|
||
|
||
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
|
||
|
||
\" SHA256STAMP:7a2b2f0bbadde70507b72a88355c4c41817a37e9f8e3211db3e9cb5b678c1b20
|