You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
2.3 KiB

.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]
.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 the any number of 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 \fI000msat\fR\.
\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 with attributes \fIunsigned_tx\fR and \fItxid\fR will be
returned\. You need to hand \fItxid\fR to \fBtxsend\fR or \fBtxdiscard\fR, as the
inputs of this transaction are reserved until then, or until the daemon
restarts\.
\fIunsigned_tx\fR represents the raw bitcoin transaction (not yet signed)
and \fItxid\fR represent the bitcoin transaction id\.
On failure, an error is reported and the transaction is not created\.
The following error codes may occur:
.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\.
.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)
.SH RESOURCES
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR