Struct clightningrpc::lightningrpc::LightningRPC [−][src]
pub struct LightningRPC { /* fields omitted */ }
Structure providing a high-level interface to the c-lightning daemon RPC
Methods
impl LightningRPC
[src]
impl LightningRPC
pub fn new(sockname: &Path) -> LightningRPC
[src]
pub fn new(sockname: &Path) -> LightningRPC
Create a new connection from a UNIX socket path.
Arguments
sockname
- Path of UNIX socket to connect to, by default lightningd will create a socket named.lightning/lightning-rpc
in the home directory of the user running lightningd.
pub fn getinfo(&mut self) -> Result<GetInfo, Error>
[src]
pub fn getinfo(&mut self) -> Result<GetInfo, Error>
Show information about this node.
pub fn feerates(&mut self, style: &str) -> Result<FeeRates, Error>
[src]
pub fn feerates(&mut self, style: &str) -> Result<FeeRates, Error>
Supply feerate estimates manually.
pub fn listnodes(&mut self, id: Option<String>) -> Result<ListNodes, Error>
[src]
pub fn listnodes(&mut self, id: Option<String>) -> Result<ListNodes, Error>
Show node {id} (or all, if no {id}), in our local network view.
pub fn listchannels(
&mut self,
short_channel_id: Option<String>
) -> Result<ListChannels, Error>
[src]
pub fn listchannels(
&mut self,
short_channel_id: Option<String>
) -> Result<ListChannels, Error>
Show channel {short_channel_id} (or all known channels, if no {short_channel_id}).
pub fn help(&mut self, command: Option<String>) -> Result<Help, Error>
[src]
pub fn help(&mut self, command: Option<String>) -> Result<Help, Error>
List available commands, or give verbose help on one command.
pub fn getlog(&mut self, level: Option<String>) -> Result<GetLog, Error>
[src]
pub fn getlog(&mut self, level: Option<String>) -> Result<GetLog, Error>
Show logs, with optional log {level} (info|unusual|debug|io).
pub fn listconfigs(
&mut self,
config: Option<String>
) -> Result<ListConfigs, Error>
[src]
pub fn listconfigs(
&mut self,
config: Option<String>
) -> Result<ListConfigs, Error>
List all configuration options, or with [config], just that one. Because of the dynamic nature of the returned object, unlike the other methods, this returns a HashMap (from String to Json) instead of a structure.
pub fn listpeers(
&mut self,
id: Option<String>,
level: Option<String>
) -> Result<ListPeers, Error>
[src]
pub fn listpeers(
&mut self,
id: Option<String>,
level: Option<String>
) -> Result<ListPeers, Error>
Show current peers, if {level} is set, include {log}s.
pub fn listinvoices(
&mut self,
label: Option<String>
) -> Result<ListInvoices, Error>
[src]
pub fn listinvoices(
&mut self,
label: Option<String>
) -> Result<ListInvoices, Error>
Show invoice {label} (or all, if no {label)).
pub fn invoice(
&mut self,
msatoshi: i64,
label: String,
description: String,
expiry: Option<i64>
) -> Result<Invoice, Error>
[src]
pub fn invoice(
&mut self,
msatoshi: i64,
label: String,
description: String,
expiry: Option<i64>
) -> Result<Invoice, Error>
Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour).
pub fn delinvoice(
&mut self,
label: String,
status: String
) -> Result<DelInvoice, Error>
[src]
pub fn delinvoice(
&mut self,
label: String,
status: String
) -> Result<DelInvoice, Error>
Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour).
pub fn delexpiredinvoice(
&mut self,
maxexpirytime: Option<i64>
) -> Result<DelExpiredInvoice, Error>
[src]
pub fn delexpiredinvoice(
&mut self,
maxexpirytime: Option<i64>
) -> Result<DelExpiredInvoice, Error>
Delete all expired invoices that expired as of given {maxexpirytime} (a UNIX epoch time), or all expired invoices if not specified.
pub fn autocleaninvoice(
&mut self,
cycle_seconds: Option<i64>,
expired_by: Option<i64>
) -> Result<AutoCleanInvoice, Error>
[src]
pub fn autocleaninvoice(
&mut self,
cycle_seconds: Option<i64>,
expired_by: Option<i64>
) -> Result<AutoCleanInvoice, Error>
Set up autoclean of expired invoices. Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400).
pub fn waitanyinvoice(
&mut self,
lastpay_index: Option<i64>
) -> Result<WaitAnyInvoice, Error>
[src]
pub fn waitanyinvoice(
&mut self,
lastpay_index: Option<i64>
) -> Result<WaitAnyInvoice, Error>
Wait for the next invoice to be paid, after {lastpay_index}. (if supplied)
pub fn waitinvoice(&mut self, label: String) -> Result<WaitInvoice, Error>
[src]
pub fn waitinvoice(&mut self, label: String) -> Result<WaitInvoice, Error>
Wait for an incoming payment matching the invoice with {label}.
pub fn pay(&mut self, bolt11: String, options: PayOptions) -> Result<Pay, Error>
[src]
pub fn pay(&mut self, bolt11: String, options: PayOptions) -> Result<Pay, Error>
Send a lightning payment.
Arguments
bolt11
- A string that holds the payment information in bolt11 format.options
- Options for this payment. UseDefault::default()
to not pass any options.
pub fn sendpay(
&mut self,
route: Vec<RouteItem>,
payment_hash: String,
description: Option<String>,
msatoshi: Option<i64>
) -> Result<SendPay, Error>
[src]
pub fn sendpay(
&mut self,
route: Vec<RouteItem>,
payment_hash: String,
description: Option<String>,
msatoshi: Option<i64>
) -> Result<SendPay, Error>
Send along {route} in return for preimage of {payment_hash}, with optional {description}.
pub fn waitsendpay(
&mut self,
payment_hash: String,
timeout: i64
) -> Result<WaitSendPay, Error>
[src]
pub fn waitsendpay(
&mut self,
payment_hash: String,
timeout: i64
) -> Result<WaitSendPay, Error>
Wait for payment attempt on {payment_hash} to succeed or fail, but only up to {timeout} seconds.
pub fn listpayments(
&mut self,
bolt11: Option<String>,
payment_hash: Option<String>
) -> Result<ListPayments, Error>
[src]
pub fn listpayments(
&mut self,
bolt11: Option<String>,
payment_hash: Option<String>
) -> Result<ListPayments, Error>
Show outgoing payments.
pub fn decodepay(
&mut self,
bolt11: String,
description: Option<String>
) -> Result<DecodePay, Error>
[src]
pub fn decodepay(
&mut self,
bolt11: String,
description: Option<String>
) -> Result<DecodePay, Error>
Decode {bolt11}, using {description} if necessary.
pub fn getroute(
&mut self,
id: String,
msatoshi: i64,
riskfactor: f64,
cltv: Option<i64>,
fromid: Option<String>,
fuzzpercent: Option<f64>,
seed: Option<String>
) -> Result<GetRoute, Error>
[src]
pub fn getroute(
&mut self,
id: String,
msatoshi: i64,
riskfactor: f64,
cltv: Option<i64>,
fromid: Option<String>,
fuzzpercent: Option<f64>,
seed: Option<String>
) -> Result<GetRoute, Error>
Show route to {id} for {msatoshi}, using {riskfactor} and optional {cltv} (default 9). If specified search from {fromid} otherwise use this node as source. Randomize the route with up to {fuzzpercent} (0.0 -> 100.0, default 5.0) using {seed} as an arbitrary-size string seed.
pub fn connect(
&mut self,
id: String,
host: Option<String>
) -> Result<Connect, Error>
[src]
pub fn connect(
&mut self,
id: String,
host: Option<String>
) -> Result<Connect, Error>
Connect to {id} at {host} (which can end in ':port' if not default). {id} can also be of the form id@host.
pub fn disconnect(&mut self, id: String) -> Result<Disconnect, Error>
[src]
pub fn disconnect(&mut self, id: String) -> Result<Disconnect, Error>
Disconnect from peer with {peer_id}.
pub fn fundchannel(
&mut self,
id: String,
satoshi: i64,
feerate: Option<i64>
) -> Result<FundChannel, Error>
[src]
pub fn fundchannel(
&mut self,
id: String,
satoshi: i64,
feerate: Option<i64>
) -> Result<FundChannel, Error>
Fund channel with {id} using {satoshi} (or 'all') satoshis, at optional {feerate}.
pub fn close(
&mut self,
id: String,
force: Option<bool>,
timeout: Option<i64>
) -> Result<Close, Error>
[src]
pub fn close(
&mut self,
id: String,
force: Option<bool>,
timeout: Option<i64>
) -> Result<Close, Error>
Close the channel with {id} (either peer ID, channel ID, or short channel ID). If {force} (default false) is true, force a unilateral close after {timeout} seconds (default 30), otherwise just schedule a mutual close later and fail after timing out.
pub fn ping(
&mut self,
peerid: String,
len: Option<i64>,
pongbytes: Option<i64>
) -> Result<Ping, Error>
[src]
pub fn ping(
&mut self,
peerid: String,
len: Option<i64>,
pongbytes: Option<i64>
) -> Result<Ping, Error>
Send {peerid} a ping of length {len} (default 128) asking for {pongbytes} (default 128).
pub fn listfunds(&mut self) -> Result<ListFunds, Error>
[src]
pub fn listfunds(&mut self) -> Result<ListFunds, Error>
Show available funds from the internal wallet.
pub fn withdraw(
&mut self,
destination: String,
satoshi: i64,
feerate: Option<i64>
) -> Result<Withdraw, Error>
[src]
pub fn withdraw(
&mut self,
destination: String,
satoshi: i64,
feerate: Option<i64>
) -> Result<Withdraw, Error>
Send to {destination} address {satoshi} (or 'all') amount via Bitcoin transaction, at optional {feerate}.
pub fn newaddr(&mut self, addresstype: Option<String>) -> Result<NewAddr, Error>
[src]
pub fn newaddr(&mut self, addresstype: Option<String>) -> Result<NewAddr, Error>
Get a new {bech32, p2sh-segwit} address to fund a channel (default is bech32).
pub fn stop(&mut self) -> Result<Stop, Error>
[src]
pub fn stop(&mut self) -> Result<Stop, Error>
Shut down the lightningd process.
Auto Trait Implementations
impl Send for LightningRPC
impl Send for LightningRPC
impl Sync for LightningRPC
impl Sync for LightningRPC