Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type AddressInternal
- type AddressType
- type AutoCleanInvoiceRequest
- type AutoCleanResult
- type BitcoinBackend
- func (bb *BitcoinBackend) RegisterEstimateFees(fn func() (*Btc_EstimatedFees, error))
- func (bb *BitcoinBackend) RegisterGetChainInfo(fn func() (*Btc_ChainInfo, error))
- func (bb *BitcoinBackend) RegisterGetFeeRate(fn func(uint32, string) (uint64, error))
- func (bb *BitcoinBackend) RegisterGetRawBlockByHeight(fn func(uint32) (string, string, error))
- func (bb *BitcoinBackend) RegisterGetUtxOut(fn func(string, uint32) (string, string, error))
- func (bb *BitcoinBackend) RegisterSendRawTransaction(fn func(string) error)
- type BoltExtra
- type BoltRoute
- type BoolOption
- func (o *BoolOption) GetDefault() interface{}
- func (o *BoolOption) GetDesc() string
- func (o *BoolOption) GetName() string
- func (o *BoolOption) GetValue() interface{}
- func (o *BoolOption) MarshalJSON() ([]byte, error)
- func (o *BoolOption) Set(value interface{}) error
- func (o *BoolOption) Type() string
- type BtcBackend_MethodName
- type Btc_ChainInfo
- type Btc_EstimatedFees
- type Btc_GetFeeRate
- type Btc_GetRawBlockByHeight
- type Btc_GetUtxOut
- type Btc_SendRawTransaction
- type Channel
- type ChannelFeeResult
- type ChannelInfo
- type ChannelOpened
- type ChannelOpenedEvent
- type CheckMessageRequest
- type CheckedMessage
- type CloseRequest
- type CloseResult
- type Command
- type Config
- type ConnectEvent
- type ConnectRequest
- type ConnectResult
- type ConnectSuccess
- type CreateOnionRequest
- type CreateOnionResponse
- type CustomMessageRequest
- type CustomMessageResult
- type CustomMsgReceivedEvent
- func (pc *CustomMsgReceivedEvent) Call() (jrpc2.Result, error)
- func (pc *CustomMsgReceivedEvent) Continue() *CustomMsgReceivedResponse
- func (pc *CustomMsgReceivedEvent) Fail() *CustomMsgReceivedResponse
- func (pc *CustomMsgReceivedEvent) Name() string
- func (pc *CustomMsgReceivedEvent) New() interface{}
- type CustomMsgReceivedResponse
- type DbWriteEvent
- type DbWriteResponse
- type DecodePayRequest
- type DecodedBolt11
- type DeleteExpiredInvoiceReq
- type DeleteInvoiceRequest
- type DevCrashRequest
- type DevFailRequest
- type DevForgetChannelRequest
- type DevHashResult
- type DevMemDumpRequest
- type DevMemLeakRequest
- type DevQueryShortChanIdsRequest
- type DevRHashRequest
- type DevReenableCommitRequest
- type DevRescanOutputsRequest
- type DevSignLastTxRequest
- type DisconnectEvent
- type DisconnectRequest
- type Fallback
- type FeatureBits
- type FeeDirective
- type FeeRate
- type FeeRateDetails
- type FeeRateEstimate
- type FeeRateStyle
- type FeeRatesRequest
- type FirstHop
- type ForgetChannelResult
- type ForwardEvent
- type Forwarding
- type FundChannelCancel
- type FundChannelComplete
- type FundChannelRequest
- type FundChannelResult
- type FundChannelStart
- type FundOutput
- type FundingChannel
- type FundsResult
- type GetInfoRequest
- type GetManifestMethod
- type HelpRequest
- type Hexed
- type Hook
- type Hooks
- type Hop
- type Htlc
- type HtlcAcceptedEvent
- func (ha *HtlcAcceptedEvent) Call() (jrpc2.Result, error)
- func (ha *HtlcAcceptedEvent) Continue() *HtlcAcceptedResponse
- func (ha *HtlcAcceptedEvent) ContinueWithPayload(payload string) *HtlcAcceptedResponse
- func (ha *HtlcAcceptedEvent) Fail(failCode uint16) *HtlcAcceptedResponse
- func (ha *HtlcAcceptedEvent) Name() string
- func (ha *HtlcAcceptedEvent) New() interface{}
- func (ha *HtlcAcceptedEvent) Resolve(paymentKey string) *HtlcAcceptedResponse
- type HtlcAcceptedResponse
- type HtlcAcceptedResult
- type HtlcOffer
- type InitMethod
- type IntOption
- type Invoice
- type InvoicePaidEvent
- type InvoicePaymentEvent
- type InvoicePaymentResponse
- type InvoiceRequest
- type Lightning
- func (l *Lightning) CancelFundChannel(peerId string) (bool, error)
- func (l *Lightning) CheckMessage(message, zbase string) (bool, string, error)
- func (l *Lightning) CheckMessageVerify(message, zbase, pubkey string) (bool, error)
- func (l *Lightning) Close(id string, timeout uint, destination string) (*CloseResult, error)
- func (l *Lightning) CloseNormal(id string) (*CloseResult, error)
- func (l *Lightning) CloseTo(id, destination string) (*CloseResult, error)
- func (l *Lightning) CloseToTimeoutWithStep(id string, timeout uint, destination, step string) (*CloseResult, error)
- func (l *Lightning) CloseToWithStep(id, destination, step string) (*CloseResult, error)
- func (l *Lightning) CloseWithStep(id, step string) (*CloseResult, error)
- func (l *Lightning) CompleteFundChannel(peerId, txId string, txout uint32) (channelId string, err error)
- func (l *Lightning) Connect(peerId, host string, port uint) (string, error)
- func (l *Lightning) ConnectPeer(peerId, host string, port uint) (*ConnectResult, error)
- func (l *Lightning) CreateInvoice(msat uint64, label, description string, expirySeconds uint32, ...) (*Invoice, error)
- func (l *Lightning) CreateInvoiceAny(label, description string, expirySeconds uint32, fallbacks []string, ...) (*Invoice, error)
- func (l *Lightning) CreateInvoiceExposing(msat uint64, label, description string, expirySeconds uint32, ...) (*Invoice, error)
- func (l *Lightning) CreateOnion(hops []Hop, paymentHash, sessionKey string) (*CreateOnionResponse, error)
- func (l *Lightning) DecodeBolt11(bolt11 string) (*DecodedBolt11, error)
- func (l *Lightning) DecodePay(bolt11, desc string) (*DecodedBolt11, error)
- func (l *Lightning) DeleteExpiredInvoicesSince(unixTime uint64) error
- func (l *Lightning) DeleteInvoice(label, status string) (*Invoice, error)
- func (l *Lightning) DevCrash() (interface{}, error)
- func (l *Lightning) DevFail(peerId string) error
- func (l *Lightning) DevForgetChannel(peerId string, force bool) (*ForgetChannelResult, error)
- func (l *Lightning) DevHash(secret string) (string, error)
- func (l *Lightning) DevMemDump() ([]*MemDumpEntry, error)
- func (l *Lightning) DevMemLeak() ([]*MemLeak, error)
- func (l *Lightning) DevQueryShortChanIds(peerId string, shortChanIds []string) (*QueryShortChannelIdsResponse, error)
- func (l *Lightning) DevReenableCommit(id string) error
- func (l *Lightning) DevRescanOutputs() ([]Output, error)
- func (l *Lightning) DevSignLastTx(peerId string) (string, error)
- func (l *Lightning) DisableInvoiceAutoclean() error
- func (l *Lightning) DiscardTx(txid string) (*TxResult, error)
- func (l *Lightning) Disconnect(peerId string, force bool) error
- func (l *Lightning) FeeRates(style FeeRateStyle) (*FeeRateEstimate, error)
- func (l *Lightning) FundChannel(id string, amount *Sat) (*FundChannelResult, error)
- func (l *Lightning) FundChannelAtFee(id string, amount *Sat, feerate *FeeRate) (*FundChannelResult, error)
- func (l *Lightning) FundChannelExt(id string, amount *Sat, feerate *FeeRate, announce bool, minConf *uint16, ...) (*FundChannelResult, error)
- func (l *Lightning) FundPrivateChannel(id string, amount *Sat) (*FundChannelResult, error)
- func (l *Lightning) FundPrivateChannelAtFee(id string, amount *Sat, feerate *FeeRate) (*FundChannelResult, error)
- func (l *Lightning) GetChannel(shortChanId string) ([]*Channel, error)
- func (l *Lightning) GetConfig(config string) (interface{}, error)
- func (l *Lightning) GetInfo() (*NodeInfo, error)
- func (l *Lightning) GetInvoice(label string) (*Invoice, error)
- func (l *Lightning) GetLog(level LogLevel) (*LogResponse, error)
- func (l *Lightning) GetNode(nodeId string) (*Node, error)
- func (l *Lightning) GetPayStatus(bolt11 string) (*PayStatus, error)
- func (l *Lightning) GetPeer(peerId string) (*Peer, error)
- func (l *Lightning) GetPeerWithLogs(peerId string, level LogLevel) (*Peer, error)
- func (l *Lightning) GetRoute(peerId string, msats uint64, riskfactor float32, cltv uint, fromId string, ...) ([]RouteHop, error)
- func (l *Lightning) GetRouteSimple(peerId string, msats uint64, riskfactor float32) ([]RouteHop, error)
- func (l *Lightning) GetSharedSecret(point string) (string, error)
- func (l *Lightning) Help() ([]*Command, error)
- func (l *Lightning) HelpFor(command string) (*Command, error)
- func (l *Lightning) Invoice(msat uint64, label, description string) (*Invoice, error)
- func (l *Lightning) IsUp() bool
- func (l *Lightning) ListChannels() ([]*Channel, error)
- func (l *Lightning) ListChannelsBySource(nodeId string) ([]*Channel, error)
- func (l *Lightning) ListConfigs() (map[string]interface{}, error)
- func (l *Lightning) ListForwards() ([]Forwarding, error)
- func (l *Lightning) ListFunds() (*FundsResult, error)
- func (l *Lightning) ListInvoices() ([]*Invoice, error)
- func (l *Lightning) ListNodes() ([]*Node, error)
- func (l *Lightning) ListPayStatuses() ([]PayStatus, error)
- func (l *Lightning) ListPays() ([]PaymentFields, error)
- func (l *Lightning) ListPaysToBolt11(bolt11 string) ([]PaymentFields, error)
- func (l *Lightning) ListPeers() ([]*Peer, error)
- func (l *Lightning) ListPeersWithLogs(level LogLevel) ([]*Peer, error)
- func (l *Lightning) ListPlugins() ([]PluginInfo, error)
- func (l *Lightning) ListSendPays(bolt11 string) ([]SendPayFields, error)
- func (l *Lightning) ListSendPaysAll() ([]SendPayFields, error)
- func (l *Lightning) ListSendPaysByHash(paymentHash string) ([]SendPayFields, error)
- func (l *Lightning) ListTransactions() ([]Transaction, error)
- func (l *Lightning) NewAddr() (string, error)
- func (l *Lightning) NewAddress(addrType AddressType) (*NewAddrResult, error)
- func (l *Lightning) Pay(req *PayRequest) (*PaymentSuccess, error)
- func (l *Lightning) PayBolt(bolt11 string) (*PaymentSuccess, error)
- func (l *Lightning) Ping(peerId string) (*Pong, error)
- func (l *Lightning) PingWithLen(peerId string, pingLen, pongByteLen uint) (*Pong, error)
- func (l *Lightning) PrepareTx(outputs []*Outputs, feerate *FeeRate, minConf *uint16) (*TxResult, error)
- func (l *Lightning) PrepareTxWithUtxos(outputs []*Outputs, feerate *FeeRate, minConf *uint16, utxos []*Utxo) (*TxResult, error)
- func (l *Lightning) Request(m jrpc2.Method, resp interface{}) error
- func (l *Lightning) RescanPlugins() ([]PluginInfo, error)
- func (l *Lightning) SendCustomMessage(nodeId, message string) (*CustomMessageResult, error)
- func (l *Lightning) SendOnion(onion string, hop FirstHop, paymentHash string) (*SendPayFields, error)
- func (l *Lightning) SendOnionWithDetails(onion string, hop FirstHop, paymentHash string, label string, secrets []string, ...) (*SendPayFields, error)
- func (l *Lightning) SendPay(route []RouteHop, paymentHash, label string, msat *uint64, bolt11 string, ...) (*SendPayResult, error)
- func (l *Lightning) SendPayLite(route []RouteHop, paymentHash string) (*SendPayResult, error)
- func (l *Lightning) SendTx(txid string) (*TxResult, error)
- func (l *Lightning) SetChannelFee(id string, baseMsat string, ppm uint32) (*ChannelFeeResult, error)
- func (l *Lightning) SetInvoiceAutoclean(intervalSeconds, expiredBySeconds uint32) error
- func (l *Lightning) SetPluginStartDir(directory string) ([]PluginInfo, error)
- func (l *Lightning) SetTimeout(secs uint)
- func (l *Lightning) Shutdown()
- func (l *Lightning) SignMessage(message string) (*SignedMessage, error)
- func (l *Lightning) StartFundChannel(id string, amount uint64, announce bool, feerate *FeeRate, closeTo string) (*StartResponse, error)
- func (l *Lightning) StartPlugin(pluginName string) ([]PluginInfo, error)
- func (l *Lightning) StartUp(rpcfile, lightningDir string) error
- func (l *Lightning) Stop() (string, error)
- func (l *Lightning) StopPlugin(pluginName string) (string, error)
- func (l *Lightning) WaitAnyInvoice(lastPayIndex uint) (*Invoice, error)
- func (l *Lightning) WaitAnyInvoiceTimeout(lastPayIndex uint, timeout uint) (*Invoice, error)
- func (l *Lightning) WaitInvoice(label string) (*Invoice, error)
- func (l *Lightning) WaitSendPay(paymentHash string, timeout uint) (*SendPayFields, error)
- func (l *Lightning) WaitSendPayPart(paymentHash string, timeout uint, partId uint64) (*SendPayFields, error)
- func (l *Lightning) Withdraw(destination string, amount *Sat, feerate *FeeRate, minConf *uint16) (*WithdrawResult, error)
- func (l *Lightning) WithdrawWithUtxos(destination string, amount *Sat, feerate *FeeRate, minConf *uint16, ...) (*WithdrawResult, error)
- type ListChannelRequest
- type ListConfigsRequest
- type ListForwardsRequest
- type ListFundsRequest
- type ListInvoiceRequest
- type ListNodeRequest
- type ListPaysRequest
- type ListPeersRequest
- type ListSendPaysRequest
- type Log
- type LogLevel
- type LogNotification
- type LogRequest
- type LogResponse
- type MSat
- type Manifest
- type MemDumpEntry
- type MemLeak
- type MemLeakResult
- type Method_EstimateFees
- type Method_GetChainInfo
- type Method_GetFeeRate
- type Method_GetRawBlockByHeight
- type Method_GetUtxOut
- type Method_SendRawTransaction
- type NewAddrRequest
- type NewAddrResult
- type Node
- type NodeInfo
- type OnchainEstimate
- type Onion
- type OpenChannel
- type OpenChannelEvent
- func (oc *OpenChannelEvent) Call() (jrpc2.Result, error)
- func (oc *OpenChannelEvent) Continue() *OpenChannelResponse
- func (oc *OpenChannelEvent) ContinueWithCloseTo(address string) *OpenChannelResponse
- func (oc *OpenChannelEvent) Name() string
- func (oc *OpenChannelEvent) New() interface{}
- func (oc *OpenChannelEvent) Reject(errorMessage string) *OpenChannelResponse
- type OpenChannelResponse
- type OpenChannelResult
- type Option
- type OptionType
- type Output
- type Outputs
- type PayAttempt
- type PayAttemptFailure
- type PayFailure
- type PayRequest
- type PayStatus
- type PayStatusRequest
- type Payment
- type PaymentError
- type PaymentErrorData
- type PaymentFields
- type PaymentSuccess
- type Peer
- type PeerChannel
- type PeerConnectedEvent
- type PeerConnectedResponse
- type PeerEvent
- type PerHop
- type PingRequest
- type Plugin
- func (p *Plugin) AddChannelFeatures(bits []byte)
- func (p *Plugin) AddInitFeatures(bits []byte)
- func (p *Plugin) AddInvoiceFeatures(bits []byte)
- func (p *Plugin) AddNodeFeatures(bits []byte)
- func (p *Plugin) GetBoolOption(name string) (bool, error)
- func (p *Plugin) GetIntOption(name string) (int, error)
- func (p *Plugin) GetOption(name string) (string, error)
- func (p *Plugin) IsOptionFlagged(name string) (bool, error)
- func (p *Plugin) Log(message string, level LogLevel)
- func (p *Plugin) RegisterHooks(hooks *Hooks) error
- func (p *Plugin) RegisterMethod(m *RpcMethod) error
- func (p *Plugin) RegisterNewBoolOption(optionName, description string, defaultVal bool) error
- func (p *Plugin) RegisterNewFlagOption(optionName, description string) error
- func (p *Plugin) RegisterNewIntOption(optionName, description string, defaultVal int) error
- func (p *Plugin) RegisterNewOption(optionName, description, defaultVal string) error
- func (p *Plugin) RegisterOption(o Option) error
- func (p *Plugin) SetDynamic(d bool)
- func (p *Plugin) Start(in, out *os.File) error
- func (p *Plugin) Stop()
- func (p *Plugin) SubscribeChannelOpened(cb func(c *ChannelOpened))
- func (p *Plugin) SubscribeConnect(cb func(c *ConnectEvent))
- func (p *Plugin) SubscribeDisconnect(cb func(c *DisconnectEvent))
- func (p *Plugin) SubscribeForwardings(cb func(c *Forwarding))
- func (p *Plugin) SubscribeInvoicePaid(cb func(c *Payment))
- func (p *Plugin) SubscribeSendPayFailure(cb func(c *SendPayFailure))
- func (p *Plugin) SubscribeSendPaySuccess(cb func(c *SendPaySuccess))
- func (p *Plugin) SubscribeWarnings(cb func(c *Warning))
- func (p *Plugin) UnregisterMethod(rpc *RpcMethod) error
- func (p *Plugin) UnregisterOption(o Option) error
- type PluginInfo
- type PluginRequest
- type PluginRequestDir
- type PluginRequestPlugin
- type Pong
- type QueryShortChannelIdsResponse
- type Route
- type RouteHop
- type RouteRequest
- type RpcCmd
- type RpcCommandEvent
- func (rc *RpcCommandEvent) Call() (jrpc2.Result, error)
- func (rc *RpcCommandEvent) Continue() *RpcCommandResponse
- func (rc *RpcCommandEvent) Name() string
- func (rc *RpcCommandEvent) New() interface{}
- func (rc *RpcCommandEvent) ReplaceWith(m jrpc2.Method) *RpcCommandResponse
- func (rc *RpcCommandEvent) ReturnError(errMsg string, errCode int) (*RpcCommandResponse, error)
- func (rc *RpcCommandEvent) ReturnResult(resp RpcCommand_Return) (*RpcCommandResponse, error)
- type RpcCommandResponse
- type RpcCommand_Return
- type RpcMethod
- type Sat
- type SendOnionRequest
- type SendPayFailure
- type SendPayFailureData
- type SendPayFailureEvent
- type SendPayFields
- type SendPayRequest
- type SendPayResult
- type SendPaySuccess
- type SendPaySuccessEvent
- type SetChannelFeeRequest
- type SharedSecretRequest
- type SharedSecretResp
- type SignMessageRequest
- type SignedMessage
- type StartResponse
- type StopRequest
- type StringOption
- func (o *StringOption) GetDefault() interface{}
- func (o *StringOption) GetDesc() string
- func (o *StringOption) GetName() string
- func (o *StringOption) GetValue() interface{}
- func (o *StringOption) MarshalJSON() ([]byte, error)
- func (o *StringOption) Set(value interface{}) error
- func (o *StringOption) Type() string
- type Subscription
- type Transaction
- type TransactionsRequest
- type TxDiscard
- type TxInput
- type TxOutput
- type TxPrepare
- type TxResult
- type TxSend
- type Utxo
- type WaitAnyInvoiceRequest
- type WaitInvoiceRequest
- type WaitSendPayRequest
- type WarnEvent
- type Warning
- type WithdrawRequest
- type WithdrawResult
Constants ¶
const FormatSimple string = "simple"
Variables ¶
var Lightning_RpcMethods map[string](func() jrpc2.Method)
List of all non-dev RPC methods
Functions ¶
This section is empty.
Types ¶
type AddressInternal ¶
type AddressType ¶
type AddressType int
const ( Bech32 AddressType = iota P2SHSegwit All )
func (AddressType) String ¶
func (a AddressType) String() string
type AutoCleanInvoiceRequest ¶
type AutoCleanInvoiceRequest struct {
CycleSeconds uint32 `json:"cycle_seconds"`
ExpiredBySeconds uint32 `json:"expired_by,omitempty"`
}
func (AutoCleanInvoiceRequest) Name ¶
func (r AutoCleanInvoiceRequest) Name() string
type AutoCleanResult ¶
type AutoCleanResult struct{}
type BitcoinBackend ¶ added in v0.8.1
type BitcoinBackend struct {
// contains filtered or unexported fields
}
func NewBitcoinBackend ¶ added in v0.8.1
func NewBitcoinBackend(p *Plugin) *BitcoinBackend
func (*BitcoinBackend) RegisterEstimateFees ¶ added in v0.8.2
func (bb *BitcoinBackend) RegisterEstimateFees(fn func() (*Btc_EstimatedFees, error))
func (*BitcoinBackend) RegisterGetChainInfo ¶ added in v0.8.1
func (bb *BitcoinBackend) RegisterGetChainInfo(fn func() (*Btc_ChainInfo, error))
func (*BitcoinBackend) RegisterGetFeeRate ¶ added in v0.8.1
func (bb *BitcoinBackend) RegisterGetFeeRate(fn func(uint32, string) (uint64, error))
func (*BitcoinBackend) RegisterGetRawBlockByHeight ¶ added in v0.8.1
func (bb *BitcoinBackend) RegisterGetRawBlockByHeight(fn func(uint32) (string, string, error))
func (*BitcoinBackend) RegisterGetUtxOut ¶ added in v0.8.1
func (*BitcoinBackend) RegisterSendRawTransaction ¶ added in v0.8.1
func (bb *BitcoinBackend) RegisterSendRawTransaction(fn func(string) error)
type BoolOption ¶ added in v0.8.2
type BoolOption struct {
Name string
Default bool
Val bool
// contains filtered or unexported fields
}
func NewBoolOption ¶ added in v0.8.2
func NewBoolOption(name, description string, defaultValue bool) *BoolOption
func (*BoolOption) GetDefault ¶ added in v0.8.2
func (o *BoolOption) GetDefault() interface{}
func (*BoolOption) GetDesc ¶ added in v0.8.2
func (o *BoolOption) GetDesc() string
func (*BoolOption) GetName ¶ added in v0.8.2
func (o *BoolOption) GetName() string
func (*BoolOption) GetValue ¶ added in v0.8.2
func (o *BoolOption) GetValue() interface{}
func (*BoolOption) MarshalJSON ¶ added in v0.8.2
func (o *BoolOption) MarshalJSON() ([]byte, error)
func (*BoolOption) Set ¶ added in v0.8.2
func (o *BoolOption) Set(value interface{}) error
func (*BoolOption) Type ¶ added in v0.8.2
func (o *BoolOption) Type() string
type BtcBackend_MethodName ¶ added in v0.8.1
type BtcBackend_MethodName string
type Btc_ChainInfo ¶ added in v0.8.1
type Btc_EstimatedFees ¶ added in v0.8.2
type Btc_EstimatedFees struct {
Opening uint64 `json:"opening"`
MutualClose uint64 `json:"mutual_close"`
UnilateralClose uint64 `json:"unilateral_close"`
DelayedToUs uint64 `json:"delayed_to_us"`
HtlcResolution uint64 `json:"htlc_resolution"`
Penalty uint64 `json:"penalty"`
MinAcceptable uint64 `json:"min_acceptable"`
MaxAcceptable uint64 `json:"max_acceptable"`
}
type Btc_GetFeeRate ¶ added in v0.8.1
type Btc_GetFeeRate struct {
// to be denominated in satoshi per kilo-vbyte
FeeRate uint64 `json:"feerate"`
}
type Btc_GetRawBlockByHeight ¶ added in v0.8.1
type Btc_GetUtxOut ¶ added in v0.8.1
type Btc_SendRawTransaction ¶ added in v0.8.1
type Channel ¶
type Channel struct {
Source string `json:"source"`
Destination string `json:"destination"`
ShortChannelId string `json:"short_channel_id"`
IsPublic bool `json:"public"`
Satoshis uint64 `json:"satoshis"`
AmountMsat string `json:"amount_msat"`
MessageFlags uint `json:"message_flags"`
ChannelFlags uint `json:"channel_flags"`
IsActive bool `json:"active"`
LastUpdate uint `json:"last_update"`
BaseFeeMillisatoshi uint64 `json:"base_fee_millisatoshi"`
FeePerMillionth uint64 `json:"fee_per_millionth"`
Delay uint `json:"delay"`
HtlcMinimumMilliSatoshis string `json:"htlc_minimum_msat"`
HtlcMaximumMilliSatoshis string `json:"htlc_maximum_msat"`
}
type ChannelFeeResult ¶
type ChannelFeeResult struct {
Base uint64 `json:"base"`
PartPerMillion uint64 `json:"ppm"`
Channels []ChannelInfo `json:"channels"`
}
type ChannelInfo ¶
type ChannelOpened ¶
type ChannelOpenedEvent ¶
type ChannelOpenedEvent struct {
ChannelOpened ChannelOpened `json:"channel_opened"`
// contains filtered or unexported fields
}
func (*ChannelOpenedEvent) Name ¶
func (e *ChannelOpenedEvent) Name() string
func (*ChannelOpenedEvent) New ¶
func (e *ChannelOpenedEvent) New() interface{}
type CheckMessageRequest ¶ added in v0.8.0
type CheckMessageRequest struct {
Message string `json:"message"`
ZBase string `json:"zbase"`
Pubkey string `json:"pubkey,omitempty"`
}
func (CheckMessageRequest) Name ¶ added in v0.8.0
func (r CheckMessageRequest) Name() string
type CheckedMessage ¶ added in v0.8.0
type CloseRequest ¶
type CloseRequest struct {
PeerId string `json:"id"`
Timeout uint `json:"unilateraltimeout,omitempty"`
Destination string `json:"destination,omitempty"`
FeeNegotiationStep string `json:"fee_negotiation_step,omitempty"`
}
func (CloseRequest) Name ¶
func (r CloseRequest) Name() string
type CloseResult ¶
type Config ¶
type Config struct {
LightningDir string `json:"lightning-dir"`
RpcFile string `json:"rpc-file"`
Startup bool `json:"startup,omitempty"`
Network string `json:"network,omitempty"`
Features *FeatureBits `json:"feature_set,omitempty"`
}
type ConnectEvent ¶
type ConnectEvent struct {
PeerId string `json:"id"`
Address Address `json:"address"`
// contains filtered or unexported fields
}
func (*ConnectEvent) Name ¶
func (e *ConnectEvent) Name() string
func (*ConnectEvent) New ¶
func (e *ConnectEvent) New() interface{}
type ConnectRequest ¶
type ConnectRequest struct {
PeerId string `json:"id"`
Host string `json:"host"`
Port uint `json:"port"`
}
func (ConnectRequest) Name ¶
func (r ConnectRequest) Name() string
type ConnectResult ¶ added in v0.8.2
type ConnectSuccess ¶
type ConnectSuccess struct {
PeerId string `json:"id"`
}
type CreateOnionRequest ¶ added in v0.8.0
type CreateOnionRequest struct {
Hops []Hop `json:"hops"`
// Data onion should commit to, must match `payment_hash`
AssociatedData string `json:"assocdata"`
// Optional, can be used to generate shared secrets
SessionKey string `json:"session_key,omitempty"`
}
func (CreateOnionRequest) Name ¶ added in v0.8.0
func (r CreateOnionRequest) Name() string
type CreateOnionResponse ¶ added in v0.8.0
type CreateOnionResponse struct {
Onion string `json:"onion"`
}
type CustomMessageRequest ¶ added in v0.8.3
func (*CustomMessageRequest) Name ¶ added in v0.8.3
func (r *CustomMessageRequest) Name() string
type CustomMessageResult ¶ added in v0.8.3
type CustomMsgReceivedEvent ¶ added in v0.8.3
type CustomMsgReceivedEvent struct {
PeerId string `json:"peer_id"`
Payload string `json:"payload"`
// contains filtered or unexported fields
}
The custommsg plugin hook is the receiving counterpart to the dev-sendcustommsg RPC method and allows plugins to handle messages that are not handled internally.
func (*CustomMsgReceivedEvent) Call ¶ added in v0.8.3
func (pc *CustomMsgReceivedEvent) Call() (jrpc2.Result, error)
func (*CustomMsgReceivedEvent) Continue ¶ added in v0.8.3
func (pc *CustomMsgReceivedEvent) Continue() *CustomMsgReceivedResponse
func (*CustomMsgReceivedEvent) Fail ¶ added in v0.8.3
func (pc *CustomMsgReceivedEvent) Fail() *CustomMsgReceivedResponse
func (*CustomMsgReceivedEvent) Name ¶ added in v0.8.3
func (pc *CustomMsgReceivedEvent) Name() string
func (*CustomMsgReceivedEvent) New ¶ added in v0.8.3
func (pc *CustomMsgReceivedEvent) New() interface{}
type CustomMsgReceivedResponse ¶ added in v0.8.3
type CustomMsgReceivedResponse struct {
Result _CustomMsgReceivedResult `json:"result"`
}
type DbWriteEvent ¶
type DbWriteEvent struct {
Writes []string `json:"writes"`
DataVersion uint64 `json:"data_version"`
// contains filtered or unexported fields
}
Note that this Hook is called before the plugin is initialized. A plugin that registers for this hook may not register for any other hooks.
func (*DbWriteEvent) Continue ¶ added in v0.8.1
func (dbw *DbWriteEvent) Continue() *DbWriteResponse
func (*DbWriteEvent) Fail ¶ added in v0.8.1
func (dbw *DbWriteEvent) Fail() *DbWriteResponse
func (*DbWriteEvent) Name ¶
func (dbw *DbWriteEvent) Name() string
func (*DbWriteEvent) New ¶
func (dbw *DbWriteEvent) New() interface{}
type DbWriteResponse ¶ added in v0.8.1
type DbWriteResponse struct {
Result _DbWrite_Result `json:"result,omitempty"`
}
type DecodePayRequest ¶
type DecodePayRequest struct {
Bolt11 string `json:"bolt11"`
Description string `json:"description,omitempty"`
}
func (DecodePayRequest) Name ¶
func (r DecodePayRequest) Name() string
type DecodedBolt11 ¶
type DecodedBolt11 struct {
Currency string `json:"currency"`
CreatedAt uint64 `json:"created_at"`
Expiry uint64 `json:"expiry"`
Payee string `json:"payee"`
MilliSatoshis uint64 `json:"msatoshi"`
AmountMsat string `json:"amount_msat"`
Description string `json:"description"`
DescriptionHash string `json:"description_hash"`
MinFinalCltvExpiry int `json:"min_final_cltv_expiry"`
Fallbacks []Fallback `json:"fallbacks"`
Routes [][]BoltRoute `json:"routes"`
Extra []BoltExtra `json:"extra"`
PaymentHash string `json:"payment_hash"`
PaymentSecret string `json:"payment_secret"`
Signature string `json:"signature"`
Features Hexed `json:"features"`
}
type DeleteExpiredInvoiceReq ¶
type DeleteExpiredInvoiceReq struct {
MaxExpiryTime uint64 `json:"maxexpirytime,omitempty"`
}
func (DeleteExpiredInvoiceReq) Name ¶
func (r DeleteExpiredInvoiceReq) Name() string
type DeleteInvoiceRequest ¶
func (DeleteInvoiceRequest) Name ¶
func (r DeleteInvoiceRequest) Name() string
type DevCrashRequest ¶
type DevCrashRequest struct{}
func (DevCrashRequest) Name ¶
func (r DevCrashRequest) Name() string
type DevFailRequest ¶
type DevFailRequest struct {
PeerId string `json:"id"`
}
func (DevFailRequest) Name ¶
func (r DevFailRequest) Name() string
type DevForgetChannelRequest ¶
func (*DevForgetChannelRequest) Name ¶
func (r *DevForgetChannelRequest) Name() string
type DevHashResult ¶
type DevHashResult struct {
RHash string `json:"rhash"`
}
type DevMemDumpRequest ¶
type DevMemDumpRequest struct{}
func (DevMemDumpRequest) Name ¶
func (r DevMemDumpRequest) Name() string
type DevMemLeakRequest ¶
type DevMemLeakRequest struct{}
func (DevMemLeakRequest) Name ¶
func (r DevMemLeakRequest) Name() string
type DevQueryShortChanIdsRequest ¶
type DevQueryShortChanIdsRequest struct {
PeerId string `json:"id"`
ShortChanIds []string `json:"scids"`
}
func (DevQueryShortChanIdsRequest) Name ¶
func (r DevQueryShortChanIdsRequest) Name() string
type DevRHashRequest ¶
type DevRHashRequest struct {
Secret string `json:"secret"`
}
func (DevRHashRequest) Name ¶
func (r DevRHashRequest) Name() string
type DevReenableCommitRequest ¶
type DevReenableCommitRequest struct {
PeerId string `json:"id"`
}
func (DevReenableCommitRequest) Name ¶
func (r DevReenableCommitRequest) Name() string
type DevRescanOutputsRequest ¶
type DevRescanOutputsRequest struct{}
func (*DevRescanOutputsRequest) Name ¶
func (r *DevRescanOutputsRequest) Name() string
type DevSignLastTxRequest ¶
type DevSignLastTxRequest struct {
PeerId string `json:"id"`
}
func (DevSignLastTxRequest) Name ¶
func (r DevSignLastTxRequest) Name() string
type DisconnectEvent ¶
type DisconnectEvent struct {
PeerId string `json:"id"`
// contains filtered or unexported fields
}
func (*DisconnectEvent) Name ¶
func (e *DisconnectEvent) Name() string
func (*DisconnectEvent) New ¶
func (e *DisconnectEvent) New() interface{}
type DisconnectRequest ¶
func (*DisconnectRequest) Name ¶
func (r *DisconnectRequest) Name() string
type FeatureBits ¶ added in v0.8.1
type FeatureBits struct {
Node *Hexed `json:"node,omitempty"`
Init *Hexed `json:"init,omitempty"`
Invoice *Hexed `json:"invoice,omitempty"`
Channel *Hexed `json:"channel,omitempty"`
}
func (*FeatureBits) AreSet ¶ added in v0.8.1
func (fb *FeatureBits) AreSet() bool
type FeeDirective ¶
type FeeDirective int
const ( Normal FeeDirective = iota Urgent Slow )
func (FeeDirective) String ¶
func (f FeeDirective) String() string
type FeeRate ¶
type FeeRate struct {
Rate uint
Style FeeRateStyle
Directive FeeDirective
}
func NewFeeRate ¶
func NewFeeRate(style FeeRateStyle, rate uint) *FeeRate
func NewFeeRateByDirective ¶
func NewFeeRateByDirective(style FeeRateStyle, directive FeeDirective) *FeeRate
type FeeRateDetails ¶
type FeeRateDetails struct {
Urgent int `json:"urgent"`
Normal int `json:"normal"`
Slow int `json:"slow"`
MinAcceptable int `json:"min_acceptable"`
MaxAcceptable int `json:"max_acceptable"`
Opening uint `json:"opening"`
MutualClose uint `json:"mutual_close"`
UnilateralClose uint `json:"unilateral_close"`
DelayedToUs uint `json:"delayed_to_us"`
HtlcResolution uint `json:"htlc_resolution"`
Penalty uint `json:"penalty"`
}
type FeeRateEstimate ¶
type FeeRateEstimate struct {
Style FeeRateStyle
Details *FeeRateDetails
OnchainEstimate *OnchainEstimate `json:"onchain_fee_estimates"`
Warning string `json:"warning"`
}
type FeeRateStyle ¶
type FeeRateStyle int
const ( PerKb FeeRateStyle = iota PerKw )
func (FeeRateStyle) String ¶
func (r FeeRateStyle) String() string
type FeeRatesRequest ¶
type FeeRatesRequest struct {
Style string `json:"style"`
}
func (*FeeRatesRequest) Name ¶
func (r *FeeRatesRequest) Name() string
type ForgetChannelResult ¶
type ForwardEvent ¶
type ForwardEvent struct {
Forward *Forwarding `json:"forward_event"`
// contains filtered or unexported fields
}
func (*ForwardEvent) Name ¶
func (e *ForwardEvent) Name() string
func (*ForwardEvent) New ¶
func (e *ForwardEvent) New() interface{}
type Forwarding ¶
type Forwarding struct {
InChannel string `json:"in_channel"`
OutChannel string `json:"out_channel"`
MilliSatoshiIn uint64 `json:"in_msatoshi"`
InMsat string `json:"in_msat"`
MilliSatoshiOut uint64 `json:"out_msatoshi"`
OutMsat string `json:"out_msat"`
Fee uint64 `json:"fee"`
FeeMsat string `json:"fee_msat"`
Status string `json:"status"`
PaymentHash string `json:"payment_hash"`
FailCode int `json:"failcode"`
FailReason string `json:"failreason"`
ReceivedTime float64 `json:"received_time"`
ResolvedTime float64 `json:"resolved_time"`
}
type FundChannelCancel ¶
type FundChannelCancel struct {
PeerId string `json:"id"`
}
func (FundChannelCancel) Name ¶
func (r FundChannelCancel) Name() string
type FundChannelComplete ¶
type FundChannelComplete struct {
PeerId string `json:"id"`
TxId string `json:"txid"`
TxOut uint32 `json:"txout"`
}
func (FundChannelComplete) Name ¶
func (r FundChannelComplete) Name() string
type FundChannelRequest ¶
type FundChannelRequest struct {
Id string `json:"id"`
Amount string `json:"amount"`
FeeRate string `json:"feerate,omitempty"`
Announce bool `json:"announce"`
MinConf *uint16 `json:"minconf,omitempty"`
PushMsat string `json:"push_msat,omitempty"`
}
func (FundChannelRequest) Name ¶
func (r FundChannelRequest) Name() string
type FundChannelResult ¶
type FundChannelStart ¶
type FundChannelStart struct {
Id string `json:"id"`
Amount uint64 `json:"amount"`
Announce bool `json:"announce"`
FeeRate string `json:"feerate,omitempty"`
CloseTo string `json:"close_to,omitempty"`
}
func (FundChannelStart) Name ¶
func (r FundChannelStart) Name() string
type FundOutput ¶
type FundingChannel ¶
type FundingChannel struct {
Id string `json:"peer_id"`
ShortChannelId string `json:"short_channel_id"`
OurAmountMilliSatoshi string `json:"our_amount_msat"`
AmountMilliSatoshi string `json:"amount_msat"`
ChannelSatoshi uint64 `json:"channel_sat"`
ChannelTotalSatoshi uint64 `json:"channel_total_sat"`
FundingTxId string `json:"funding_txid"`
FundingOutput int `json:"funding_output"`
Connected bool `json:"connected"`
State string `json:"state"`
}
type FundsResult ¶
type FundsResult struct {
Outputs []*FundOutput `json:"outputs"`
Channels []*FundingChannel `json:"channels"`
}
type GetInfoRequest ¶
type GetInfoRequest struct{}
func (GetInfoRequest) Name ¶
func (r GetInfoRequest) Name() string
type GetManifestMethod ¶
type GetManifestMethod struct {
// contains filtered or unexported fields
}
func (GetManifestMethod) Call ¶
func (gm GetManifestMethod) Call() (jrpc2.Result, error)
Builds the manifest object that's returned from the `getmanifest` method.
func (GetManifestMethod) Name ¶
func (gm GetManifestMethod) Name() string
func (*GetManifestMethod) New ¶
func (gm *GetManifestMethod) New() interface{}
type HelpRequest ¶
type HelpRequest struct {
Command string `json:"command,omitempty"`
}
func (HelpRequest) Name ¶
func (r HelpRequest) Name() string
type Hexed ¶ added in v0.8.1
func (*Hexed) MarshalJSON ¶ added in v0.8.1
func (*Hexed) UnmarshalJSON ¶ added in v0.8.1
type Hooks ¶
type Hooks struct {
PeerConnected func(*PeerConnectedEvent) (*PeerConnectedResponse, error)
DbWrite func(*DbWriteEvent) (*DbWriteResponse, error)
InvoicePayment func(*InvoicePaymentEvent) (*InvoicePaymentResponse, error)
OpenChannel func(*OpenChannelEvent) (*OpenChannelResponse, error)
HtlcAccepted func(*HtlcAcceptedEvent) (*HtlcAcceptedResponse, error)
RpcCommand func(*RpcCommandEvent) (*RpcCommandResponse, error)
CustomMsgReceived func(*CustomMsgReceivedEvent) (*CustomMsgReceivedResponse, error)
}
Map for registering hooks. Not the *most* elegant but
it'll do for now.
type HtlcAcceptedEvent ¶
type HtlcAcceptedEvent struct {
Onion Onion `json:"onion"`
Htlc HtlcOffer `json:"htlc"`
// contains filtered or unexported fields
}
The `htlc_accepted` hook is called whenever an incoming HTLC is accepted, and its result determines how `lightningd` should treat that HTLC.
Warning: `lightningd` will replay the HTLCs for which it doesn't have a final
verdict during startup. This means that, if the plugin response wasn't processed before the HTLC was forwarded, failed, or resolved, then the plugin may see the same HTLC again during startup. It is therefore paramount that the plugin is idempotent if it talks to an external system.
func (*HtlcAcceptedEvent) Continue ¶
func (ha *HtlcAcceptedEvent) Continue() *HtlcAcceptedResponse
func (*HtlcAcceptedEvent) ContinueWithPayload ¶ added in v0.8.2
func (ha *HtlcAcceptedEvent) ContinueWithPayload(payload string) *HtlcAcceptedResponse
func (*HtlcAcceptedEvent) Fail ¶
func (ha *HtlcAcceptedEvent) Fail(failCode uint16) *HtlcAcceptedResponse
func (*HtlcAcceptedEvent) Name ¶
func (ha *HtlcAcceptedEvent) Name() string
func (*HtlcAcceptedEvent) New ¶
func (ha *HtlcAcceptedEvent) New() interface{}
func (*HtlcAcceptedEvent) Resolve ¶
func (ha *HtlcAcceptedEvent) Resolve(paymentKey string) *HtlcAcceptedResponse
type HtlcAcceptedResponse ¶
type HtlcAcceptedResponse struct {
Result HtlcAcceptedResult `json:"result"`
// Only allowed if result is 'fail', deprecated! check
// FailureMessage
FailureCode *uint16 `json:"failure_code,omitempty"`
// Only allowed if result is 'resolve'
PaymentKey string `json:"payment_key,omitempty"`
// Replaces the onion's payload
Payload string `json:"payload,omitempty"`
}
type HtlcAcceptedResult ¶
type HtlcAcceptedResult string
type InitMethod ¶
type InitMethod struct {
Options json.RawMessage `json:"options"`
Configuration *Config `json:"configuration"`
// contains filtered or unexported fields
}
func (InitMethod) Name ¶
func (im InitMethod) Name() string
func (InitMethod) New ¶
func (im InitMethod) New() interface{}
type IntOption ¶ added in v0.8.2
func NewIntOption ¶ added in v0.8.2
func (*IntOption) GetDefault ¶ added in v0.8.2
func (o *IntOption) GetDefault() interface{}
func (*IntOption) MarshalJSON ¶ added in v0.8.2
type Invoice ¶
type Invoice struct {
Label string `json:"label"`
Bolt11 string `json:"bolt11"`
PaymentHash string `json:"payment_hash"`
AmountMilliSatoshi string `json:"amount_msat,omitempty"`
AmountMilliSatoshiRaw uint64 `json:"msatoshi,omitempty"`
Status string `json:"status"`
PayIndex uint64 `json:"pay_index,omitempty"`
MilliSatoshiReceivedRaw uint64 `json:"msatoshi_received,omitempty"`
MilliSatoshiReceived string `json:"amount_received_msat,omitempty"`
PaidAt uint64 `json:"paid_at,omitempty"`
PaymentPreImage string `json:"payment_preimage,omitempty"`
WarningOffline string `json:"warning_offline,omitempty"`
WarningCapacity string `json:"warning_capacity,omitempty"`
Description string `json:"description"`
ExpiresAt uint64 `json:"expires_at"`
}
type InvoicePaidEvent ¶
type InvoicePaidEvent struct {
Payment Payment `json:"invoice_payment"`
// contains filtered or unexported fields
}
func (*InvoicePaidEvent) Name ¶
func (e *InvoicePaidEvent) Name() string
func (*InvoicePaidEvent) New ¶
func (e *InvoicePaidEvent) New() interface{}
type InvoicePaymentEvent ¶
type InvoicePaymentEvent struct {
Payment Payment `json:"payment"`
// contains filtered or unexported fields
}
func (*InvoicePaymentEvent) Continue ¶
func (ip *InvoicePaymentEvent) Continue() *InvoicePaymentResponse
func (*InvoicePaymentEvent) Fail ¶
func (ip *InvoicePaymentEvent) Fail(failureCode uint16) *InvoicePaymentResponse
func (*InvoicePaymentEvent) Name ¶
func (ip *InvoicePaymentEvent) Name() string
func (*InvoicePaymentEvent) New ¶
func (ip *InvoicePaymentEvent) New() interface{}
type InvoicePaymentResponse ¶
type InvoiceRequest ¶
type InvoiceRequest struct {
MilliSatoshis string `json:"msatoshi"`
Label string `json:"label"`
Description string `json:"description"`
ExpirySeconds uint32 `json:"expiry,omitempty"`
Fallbacks []string `json:"fallbacks,omitempty"`
PreImage string `json:"preimage,omitempty"`
// Note that these both have the same json key. we use checks
// to make sure that only one of them is filled in
ExposePrivChansFlag *bool `json:"exposeprivatechannels,omitempty"`
ExposeTheseChannels []string `json:"exposeprivatechannels,omitempty"`
}
func (InvoiceRequest) Name ¶
func (ir InvoiceRequest) Name() string
type Lightning ¶
type Lightning struct {
// contains filtered or unexported fields
}
This file's the one that holds all the objects for the c-lightning RPC commands
func NewLightning ¶
func NewLightning() *Lightning
func (*Lightning) CancelFundChannel ¶
func (*Lightning) CheckMessage ¶ added in v0.8.0
No pubkey provided, so we return the pubkey
func (*Lightning) CheckMessageVerify ¶ added in v0.8.0
Pubkey provided, so we return whether or not is verified
func (*Lightning) Close ¶
Close the channel with peer {id}, timing out with {timeout} seconds, at whence a unilateral close is initiated.
If unspecified, forces a close (timesout) in 48hours ¶
Can pass either peer id or channel id as {id} field.
Note that a successful result *may* be null.
func (*Lightning) CloseNormal ¶
func (l *Lightning) CloseNormal(id string) (*CloseResult, error)
func (*Lightning) CloseTo ¶ added in v0.8.0
func (l *Lightning) CloseTo(id, destination string) (*CloseResult, error)
func (*Lightning) CloseToTimeoutWithStep ¶ added in v0.8.2
func (*Lightning) CloseToWithStep ¶ added in v0.8.2
func (l *Lightning) CloseToWithStep(id, destination, step string) (*CloseResult, error)
func (*Lightning) CloseWithStep ¶ added in v0.8.2
func (l *Lightning) CloseWithStep(id, step string) (*CloseResult, error)
func (*Lightning) CompleteFundChannel ¶
func (*Lightning) Connect ¶
Connect to {peerId} at {host}:{port}. Returns peer id on success Sort of deprecated, use ConnectPeer, as it gives you back the peer's init features as well
func (*Lightning) ConnectPeer ¶ added in v0.8.2
func (l *Lightning) ConnectPeer(peerId, host string, port uint) (*ConnectResult, error)
Connect to {peerId} at {host}:{port}. Returns result with peer id and peer's features
func (*Lightning) CreateInvoice ¶
func (l *Lightning) CreateInvoice(msat uint64, label, description string, expirySeconds uint32, fallbacks []string, preimage string, willExposePrivateChans bool) (*Invoice, error)
Creates an invoice with a value of `msat`. Label and description must be set.
The 'label' is a unique string or number (which is treated as a string); it is never revealed to other nodes, but it can be used to query the status of this invoice.
The 'description' is a short description of purpose of payment. It is encoded into the invoice. Must be UTF-8, cannot use '\n' JSON escape codes.
The 'expiry' is optionally the number of seconds the invoice is valid for. Defaults to 3600 (1 hour).
'fallbacks' is one or more fallback addresses to include in the invoice. They should be ordered from most preferred to least. Noe that these are not currently tracked to fulfill the invoice.
The 'preimage' is a 64-digit hex string to be used as payment preimage for the created invoice. By default, c-lightning will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **NOTE**: if you specify the 'preimage', you are responsible for both ensuring that a suitable psuedorandom generator with sufficient entropy was used in its creation and keeping it secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed.
func (*Lightning) CreateInvoiceAny ¶
func (l *Lightning) CreateInvoiceAny(label, description string, expirySeconds uint32, fallbacks []string, preimage string, exposePrivateChans bool) (*Invoice, error)
Creates an invoice with a value of "any", that can be paid with any amount
func (*Lightning) CreateInvoiceExposing ¶ added in v0.8.1
func (*Lightning) CreateOnion ¶ added in v0.8.0
func (l *Lightning) CreateOnion(hops []Hop, paymentHash, sessionKey string) (*CreateOnionResponse, error)
func (*Lightning) DecodeBolt11 ¶ added in v0.8.1
func (l *Lightning) DecodeBolt11(bolt11 string) (*DecodedBolt11, error)
func (*Lightning) DecodePay ¶
func (l *Lightning) DecodePay(bolt11, desc string) (*DecodedBolt11, error)
Decode the {bolt11}, using the provided 'description' if necessary.*
* This is only necesary if the bolt11 includes a description hash. The provided description must match the included hash.
func (*Lightning) DeleteExpiredInvoicesSince ¶
func (*Lightning) DeleteInvoice ¶
Delete unpaid invoice {label} with {status}
func (*Lightning) DevForgetChannel ¶
func (l *Lightning) DevForgetChannel(peerId string, force bool) (*ForgetChannelResult, error)
Forget channel with id {peerId}. Optionally {force} if has active channel. Caution, this might lose you funds.
func (*Lightning) DevMemDump ¶
func (l *Lightning) DevMemDump() ([]*MemDumpEntry, error)
Show memory objects currently in use
func (*Lightning) DevMemLeak ¶
Show unreferenced memory objects
func (*Lightning) DevQueryShortChanIds ¶
func (l *Lightning) DevQueryShortChanIds(peerId string, shortChanIds []string) (*QueryShortChannelIdsResponse, error)
Ask a peer for a particular set of short channel ids
func (*Lightning) DevReenableCommit ¶
Re-enable the commit timer on peer {id}
func (*Lightning) DevRescanOutputs ¶
Synchronize the state of our funds with bitcoind
func (*Lightning) DevSignLastTx ¶
Sign and show the last commitment transaction with peer {peerId} Returns the signed tx on success
func (*Lightning) DisableInvoiceAutoclean ¶
func (*Lightning) Disconnect ¶
Disconnect from peer with {peerId}. Optionally {force} if has active channel. Returns a nil response on success
func (*Lightning) FeeRates ¶
func (l *Lightning) FeeRates(style FeeRateStyle) (*FeeRateEstimate, error)
Return feerate estimates, either satoshi-per-kw or satoshi-per-kb {style}
func (*Lightning) FundChannel ¶
func (l *Lightning) FundChannel(id string, amount *Sat) (*FundChannelResult, error)
Fund channel, defaults to public channel and default feerate.
func (*Lightning) FundChannelAtFee ¶ added in v0.8.1
func (*Lightning) FundChannelExt ¶
func (l *Lightning) FundChannelExt(id string, amount *Sat, feerate *FeeRate, announce bool, minConf *uint16, pushMSat *MSat) (*FundChannelResult, error)
Fund channel with node {id} using {satoshi} satoshis, with feerate of {feerate}. Uses default feerate if unset. If announce is false, channel announcements will not be sent. can send an optional 'pushMsat', of millisatoshis to push to peer (from your funding amount) Any pushed msats are irrevocably gifted to the peer. (use only if you enjoy being a sats santa!)
func (*Lightning) FundPrivateChannel ¶ added in v0.8.1
func (l *Lightning) FundPrivateChannel(id string, amount *Sat) (*FundChannelResult, error)
func (*Lightning) FundPrivateChannelAtFee ¶ added in v0.8.1
func (*Lightning) GetChannel ¶
Get channel by {shortChanId}
func (*Lightning) GetInvoice ¶
Show invoice {label}.
func (*Lightning) GetLog ¶
func (l *Lightning) GetLog(level LogLevel) (*LogResponse, error)
Show logs, with optional log {level} (info|unusual|debug|io)
func (*Lightning) GetNode ¶
Get all nodes in our local network view, filter on node {id}, if provided
func (*Lightning) GetPayStatus ¶
Detailed information about a payment attempt to a given bolt11
func (*Lightning) GetPeerWithLogs ¶ added in v0.8.0
func (*Lightning) GetRoute ¶
func (l *Lightning) GetRoute(peerId string, msats uint64, riskfactor float32, cltv uint, fromId string, fuzzpercent float32, exclude []string, maxHops int32) ([]RouteHop, error)
Show route to {id} for {msatoshis}, using a {riskfactor} and optional {cltv} value (defaults to 9). If specified, search from {fromId} otherwise use current node as the source. Randomize the route with up to {fuzzpercent} (0.0 -> 100.0, default 5.0).
If you wish to exclude a set of channels from the route, you can pass in an optional set of channel id's with a direction (scid/direction)
func (*Lightning) GetRouteSimple ¶
func (*Lightning) GetSharedSecret ¶ added in v0.8.2
Returns the shared secret, a hexadecimal string of the 256-bit SHA-2 of the
compressed public key DER-encoding of the SECP256K1 point that is the shared secret generated using the Elliptic Curve Diffie-Hellman algorithm. This field is 32 bytes (64 hexadecimal characters in a string).
func (*Lightning) ListChannels ¶
func (*Lightning) ListChannelsBySource ¶
func (*Lightning) ListConfigs ¶
func (*Lightning) ListForwards ¶
func (l *Lightning) ListForwards() ([]Forwarding, error)
List all forwarded payments and their information
func (*Lightning) ListFunds ¶
func (l *Lightning) ListFunds() (*FundsResult, error)
Funds in wallet.
func (*Lightning) ListInvoices ¶
List all invoices
func (*Lightning) ListPayStatuses ¶
List detailed information about all payment attempts
func (*Lightning) ListPays ¶
func (l *Lightning) ListPays() ([]PaymentFields, error)
func (*Lightning) ListPaysToBolt11 ¶
func (l *Lightning) ListPaysToBolt11(bolt11 string) ([]PaymentFields, error)
func (*Lightning) ListPeersWithLogs ¶
Show current peers, if {level} is set, include logs.
func (*Lightning) ListPlugins ¶
func (l *Lightning) ListPlugins() ([]PluginInfo, error)
func (*Lightning) ListSendPays ¶
func (l *Lightning) ListSendPays(bolt11 string) ([]SendPayFields, error)
Show outgoing payments, regarding {bolt11}
func (*Lightning) ListSendPaysAll ¶
func (l *Lightning) ListSendPaysAll() ([]SendPayFields, error)
func (*Lightning) ListSendPaysByHash ¶
func (l *Lightning) ListSendPaysByHash(paymentHash string) ([]SendPayFields, error)
Show outgoing payments, regarding {paymentHash}
func (*Lightning) ListTransactions ¶ added in v0.8.0
func (l *Lightning) ListTransactions() ([]Transaction, error)
func (*Lightning) NewAddress ¶
func (l *Lightning) NewAddress(addrType AddressType) (*NewAddrResult, error)
Get new address of type {addrType} from the internal wallet.
func (*Lightning) Pay ¶
func (l *Lightning) Pay(req *PayRequest) (*PaymentSuccess, error)
Send payment as specified by 'Bolt11' with 'MilliSatoshi' (Millisatoshis amount is ignored if the 'Bolt11' includes an amount).
'description' is required if the 'bolt11' includes a description hash.
'riskfactor' is optional, defaults to 1.0 Briefly, the 'riskfactor' is the estimated annual cost of your funds being stuck (as a percentage), multiplied by the percent change of each node failing. Ex: 1% chance of node failure and a 20% annual cost would give you a risk factor of 20. c-lightning defaults to 1.0
'MaxFeePercent' is the max percentage of a payment that can be paid in fees. c-lightning defaults to 0.5.
'ExemptFee' can be used for tiny paymetns which would otherwise be dominated by the fee leveraged by forwarding nodes. Setting 'ExemptFee' allows 'MaxFeePercent' check to be skipped on fees that are smaller than 'ExemptFee'. c-lightning default is 5000 millisatoshi.
c-lightning will keep finding routes and retrying payment until it succeeds or the given 'RetryFor' seconds have elapsed. Note that the command may stop retrying while payment is pending. You can continuing monitoring payment status with the ListSendPays or WaitSendPay. 'RetryFor' defaults to 60 seconds.
'MaxDelay' is used when determining whether a route incurs an acceptable delay. A route will not be used if the estimated delay is above this. Defaults to the configured locktime max (--max-locktime-blocks) Units is in blocks.
func (*Lightning) PingWithLen ¶
Send {peerId} a ping of length {pingLen} asking for bytes {pongByteLen}
func (*Lightning) PrepareTxWithUtxos ¶ added in v0.8.0
func (*Lightning) RescanPlugins ¶
func (l *Lightning) RescanPlugins() ([]PluginInfo, error)
func (*Lightning) SendCustomMessage ¶ added in v0.8.3
func (l *Lightning) SendCustomMessage(nodeId, message string) (*CustomMessageResult, error)
func (*Lightning) SendOnionWithDetails ¶ added in v0.8.0
func (*Lightning) SendPay ¶
func (l *Lightning) SendPay(route []RouteHop, paymentHash, label string, msat *uint64, bolt11 string, paymentSecret string, partId uint64) (*SendPayResult, error)
Send along {route} in return for preimage of {paymentHash}
Description and msat are optional.
Generally a client would call GetRoute to resolve a route, then use SendPay to send it. If it fails, it would call GetRoute again to retry.
Response will occur when payment is on its way to the destination. Does not wait for a definitive success or failure. Use 'waitsendpay' to poll or wait for definite success or failure.
'description', if provided, will be returned in 'waitsendpay' and 'listsendpays' results.
'msat', if provided, is the amount that will be recorded as the target payment value. If not specified, it will be the final amount to the destination (specified in route). If specified, then the final amount at the destination must be from the specified 'msat' to twice that value, inclusive. This is inteded to obscure payments by overpaying slightly at the destination -- the acutal target paymnt is what should be specified as the 'msat' argument.
Once a payment has succeeded, calls to 'SendPay' with the same 'paymentHash' but a different 'msat' or destination will fail; this prevents accidental multiple payments. Calls with the same 'paymentHash', 'msat' and destination as a previous successful payment will return immediately with a success, even if the route is different.
func (*Lightning) SendPayLite ¶
func (l *Lightning) SendPayLite(route []RouteHop, paymentHash string) (*SendPayResult, error)
SendPay, but without description or millisatoshi value
func (*Lightning) SetChannelFee ¶
func (l *Lightning) SetChannelFee(id string, baseMsat string, ppm uint32) (*ChannelFeeResult, error)
Set the channel fee for a given channel. 'id' can be a peer id, a channel id, a short channel id, or all, for all channels.
func (*Lightning) SetInvoiceAutoclean ¶
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).
func (*Lightning) SetPluginStartDir ¶
func (l *Lightning) SetPluginStartDir(directory string) ([]PluginInfo, error)
func (*Lightning) SetTimeout ¶
func (*Lightning) SignMessage ¶ added in v0.8.0
func (l *Lightning) SignMessage(message string) (*SignedMessage, error)
func (*Lightning) StartFundChannel ¶
func (l *Lightning) StartFundChannel(id string, amount uint64, announce bool, feerate *FeeRate, closeTo string) (*StartResponse, error)
Returns a string that's a bech32 address. this address is the funding output address.
func (*Lightning) StartPlugin ¶
func (l *Lightning) StartPlugin(pluginName string) ([]PluginInfo, error)
func (*Lightning) Stop ¶
Shut down the c-lightning process. Will return a string of "Shutting down" on success.
func (*Lightning) WaitAnyInvoice ¶
Waits until an invoice is paid, then returns a single entry. Will not return or provide any invoices paid prior to or including the lastPayIndex.
The 'pay index' is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid 'pay index' is 1.
This blocks until it receives a response.
func (*Lightning) WaitAnyInvoiceTimeout ¶ added in v0.8.1
Note that if timeout is zero, it won't be sent. which is fine, a zero timeout doesn't really make a lot of sense
func (*Lightning) WaitInvoice ¶
Wait for invoice to be filled or for invoice to expire. This blocks until a result is returned from the server and by passes client timeout safeguards.
func (*Lightning) WaitSendPay ¶
func (l *Lightning) WaitSendPay(paymentHash string, timeout uint) (*SendPayFields, error)
Polls or waits for the status of an outgoing payment that was initiated by a previous 'SendPay' invocation.
May provide a 'timeout, in seconds. When provided, will return a 200 error code (payment still in progress) if timeout elapses before the payment is definitively concluded (success or fail). If no 'timeout' is provided, the call waits indefinitely.
NB: Blocking. Bypasses the default client request timeout mechanism
func (*Lightning) WaitSendPayPart ¶ added in v0.8.0
func (*Lightning) Withdraw ¶
func (l *Lightning) Withdraw(destination string, amount *Sat, feerate *FeeRate, minConf *uint16) (*WithdrawResult, error)
Withdraw sends funds from c-lightning's internal wallet to the address specified in {destination}. Address can be of any Bitcoin accepted type, including bech32.
{satoshi} is the amount to be withdrawn from the wallet.
{feerate} is an optional feerate to use. Can be either a directive (urgent, normal, or slow) or a number with an optional suffix. 'perkw' means the number is interpreted as satoshi-per-kilosipa (weight) and 'perkb' means it is interpreted bitcoind-style as satoshi-per-kilobyte. Omitting the suffix is equivalent to 'perkb' If not set, {feerate} defaults to 'normal'.
func (*Lightning) WithdrawWithUtxos ¶ added in v0.8.0
type ListChannelRequest ¶
type ListChannelRequest struct {
ShortChannelId string `json:"short_channel_id,omitempty"`
Source string `json:"source,omitempty"`
}
func (ListChannelRequest) Name ¶
func (lc ListChannelRequest) Name() string
type ListConfigsRequest ¶
type ListConfigsRequest struct {
Config string `json:"config,omitempty"`
}
func (ListConfigsRequest) Name ¶
func (r ListConfigsRequest) Name() string
func (*ListConfigsRequest) New ¶
func (r *ListConfigsRequest) New() interface{}
type ListForwardsRequest ¶
type ListForwardsRequest struct{}
func (*ListForwardsRequest) Name ¶
func (r *ListForwardsRequest) Name() string
type ListFundsRequest ¶
type ListFundsRequest struct{}
func (*ListFundsRequest) Name ¶
func (r *ListFundsRequest) Name() string
type ListInvoiceRequest ¶
type ListInvoiceRequest struct {
Label string `json:"label,omitempty"`
}
func (ListInvoiceRequest) Name ¶
func (r ListInvoiceRequest) Name() string
type ListNodeRequest ¶
type ListNodeRequest struct {
NodeId string `json:"id,omitempty"`
}
func (ListNodeRequest) Name ¶
func (ln ListNodeRequest) Name() string
type ListPaysRequest ¶
type ListPaysRequest struct {
Bolt11 string `json:"bolt11,omitempty"`
}
func (ListPaysRequest) Name ¶
func (r ListPaysRequest) Name() string
type ListPeersRequest ¶
type ListPeersRequest struct {
PeerId string `json:"id,omitempty"`
Level string `json:"level,omitempty"`
}
func (ListPeersRequest) Name ¶
func (r ListPeersRequest) Name() string
type ListSendPaysRequest ¶
type ListSendPaysRequest struct {
Bolt11 string `json:"bolt11,omitempty"`
PaymentHash string `json:"payment_hash,omitempty"`
}
func (ListSendPaysRequest) Name ¶
func (r ListSendPaysRequest) Name() string
type LogNotification ¶
func (*LogNotification) Name ¶
func (r *LogNotification) Name() string
type LogRequest ¶
type LogRequest struct {
Level string `json:"level,omitempty"`
}
func (LogRequest) Name ¶
func (r LogRequest) Name() string
type LogResponse ¶
type MSat ¶ added in v0.8.1
type MSat struct {
Value uint64
}
func (*MSat) ConvertSat ¶ added in v0.8.1
Always rounds up to nearest satoshi
type MemDumpEntry ¶
type MemDumpEntry struct {
ParentPtr string `json:"parent"`
ValuePtr string `json:"value"`
Label string `json:"label"`
Children []*MemDumpEntry `json:"children"`
}
type MemLeakResult ¶
type MemLeakResult struct {
Leaks []*MemLeak `json:"leaks"`
}
type Method_EstimateFees ¶ added in v0.8.2
type Method_EstimateFees struct {
// contains filtered or unexported fields
}
func (Method_EstimateFees) Call ¶ added in v0.8.2
func (m Method_EstimateFees) Call() (jrpc2.Result, error)
func (Method_EstimateFees) Name ¶ added in v0.8.2
func (m Method_EstimateFees) Name() string
func (Method_EstimateFees) New ¶ added in v0.8.2
func (m Method_EstimateFees) New() interface{}
type Method_GetChainInfo ¶ added in v0.8.1
type Method_GetChainInfo struct {
// contains filtered or unexported fields
}
func (Method_GetChainInfo) Call ¶ added in v0.8.1
func (m Method_GetChainInfo) Call() (jrpc2.Result, error)
func (Method_GetChainInfo) Name ¶ added in v0.8.1
func (m Method_GetChainInfo) Name() string
func (Method_GetChainInfo) New ¶ added in v0.8.1
func (m Method_GetChainInfo) New() interface{}
type Method_GetFeeRate ¶ added in v0.8.1
type Method_GetFeeRate struct {
Blocks uint32 `json:"blocks"`
// Will be either CONSERVATIVE or ECONOMICAL
Mode string `json:"mode"`
// contains filtered or unexported fields
}
func (Method_GetFeeRate) Call ¶ added in v0.8.1
func (m Method_GetFeeRate) Call() (jrpc2.Result, error)
func (Method_GetFeeRate) Name ¶ added in v0.8.1
func (m Method_GetFeeRate) Name() string
func (Method_GetFeeRate) New ¶ added in v0.8.1
func (m Method_GetFeeRate) New() interface{}
type Method_GetRawBlockByHeight ¶ added in v0.8.1
type Method_GetRawBlockByHeight struct {
Height uint32 `json:"height"`
// contains filtered or unexported fields
}
func (Method_GetRawBlockByHeight) Call ¶ added in v0.8.1
func (m Method_GetRawBlockByHeight) Call() (jrpc2.Result, error)
func (Method_GetRawBlockByHeight) Name ¶ added in v0.8.1
func (m Method_GetRawBlockByHeight) Name() string
func (Method_GetRawBlockByHeight) New ¶ added in v0.8.1
func (m Method_GetRawBlockByHeight) New() interface{}
type Method_GetUtxOut ¶ added in v0.8.1
type Method_GetUtxOut struct {
TxId string `json:"txid"`
Vout uint32 `json:"vout"`
// contains filtered or unexported fields
}
func (Method_GetUtxOut) Call ¶ added in v0.8.1
func (m Method_GetUtxOut) Call() (jrpc2.Result, error)
func (Method_GetUtxOut) Name ¶ added in v0.8.1
func (m Method_GetUtxOut) Name() string
func (Method_GetUtxOut) New ¶ added in v0.8.1
func (m Method_GetUtxOut) New() interface{}
type Method_SendRawTransaction ¶ added in v0.8.1
type Method_SendRawTransaction struct {
TxString string `json:"tx"`
// contains filtered or unexported fields
}
func (Method_SendRawTransaction) Call ¶ added in v0.8.1
func (m Method_SendRawTransaction) Call() (jrpc2.Result, error)
func (Method_SendRawTransaction) Name ¶ added in v0.8.1
func (m Method_SendRawTransaction) Name() string
func (Method_SendRawTransaction) New ¶ added in v0.8.1
func (m Method_SendRawTransaction) New() interface{}
type NewAddrRequest ¶
type NewAddrRequest struct {
AddressType string `json:"addresstype,omitempty"`
}
func (NewAddrRequest) Name ¶
func (r NewAddrRequest) Name() string
type NewAddrResult ¶
type NodeInfo ¶
type NodeInfo struct {
Id string `json:"id"`
Alias string `json:"alias"`
Color string `json:"color"`
PeerCount int `json:"num_peers"`
PendingChannelCount int `json:"num_pending_channels"`
ActiveChannelCount int `json:"num_active_channels"`
InactiveChannelCount int `json:"num_inactive_channels"`
Addresses []Address `json:"address"`
Binding []AddressInternal `json:"binding"`
Version string `json:"version"`
Blockheight uint `json:"blockheight"`
Network string `json:"network"`
FeesCollectedMilliSatoshis uint64 `json:"msatoshi_fees_collected"`
FeesCollected string `json:"fees_collected_msat"`
LightningDir string `json:"lightning-dir"`
WarningBitcoinSync string `json:"warning_bitcoind_sync,omitempty"`
WarningLightningSync string `json:"warning_lightningd_sync,omitempty"`
}
func (*NodeInfo) IsBitcoindSync ¶ added in v0.8.0
func (*NodeInfo) IsLightningdSync ¶ added in v0.8.0
type OnchainEstimate ¶
type OnchainEstimate struct {
OpeningChannelSatoshis uint64 `json:"opening_channel_satoshis"`
MutualCloseSatoshis uint64 `json:"mutual_close_satoshis"`
UnilateralCloseSatoshis uint64 `json:"unilateral_close_satoshis"`
HtlcTimeoutSatoshis uint64 `json:"htlc_timeout_satoshis"`
HtlcSuccessSatoshis uint64 `json:"htlc_success_satoshis"`
}
type Onion ¶
type Onion struct {
Payload string `json:"payload"`
NextOnion string `json:"next_onion"`
// Note that 'PerHop' is deprecated
PerHop *PerHop `json:"per_hop_v0"`
// The two type options are: 'legacy' and 'tlv'
Type string `json:"type"`
// Only included if there's a next hop/'forward channel'
ShortChannelId string `json:"short_channel_id"`
OutgoingCltv uint `json:"outgoing_cltv_value"`
ForwardAmount string `json:"forward_amount"`
PaymentSecret string `json:"payment_secret"`
// Only included if has payment secret
TotalMilliSatoshi string `json:"total_msat"`
}
type OpenChannel ¶
type OpenChannel struct {
PeerId string `json:"id"`
FundingSatoshis string `json:"funding_satoshis"`
PushMilliSatoshis string `json:"push_msat"`
DustLimitSatoshis string `json:"dust_limit_satoshis"`
MaxHtlcValueInFlightMilliSatoshis string `json:"max_htlc_value_in_flight_msat"`
ChannelReserveSatoshis string `json:"channel_reserve_satoshis"`
HtlcMinimumMillisatoshis string `json:"htlc_minimum_msat"`
FeeratePerKw int `json:"feerate_per_kw"`
ToSelfDelay int `json:"to_self_delay"`
MaxAcceptedHtlcs int `json:"max_accepted_htlcs"`
ChannelFlags int `json:"channel_flags"`
ShutdownScriptPubkey string `json:"shutdown_scriptpubkey"`
}
type OpenChannelEvent ¶
type OpenChannelEvent struct {
OpenChannel OpenChannel `json:"openchannel"`
// contains filtered or unexported fields
}
func (*OpenChannelEvent) Continue ¶
func (oc *OpenChannelEvent) Continue() *OpenChannelResponse
func (*OpenChannelEvent) ContinueWithCloseTo ¶ added in v0.8.0
func (oc *OpenChannelEvent) ContinueWithCloseTo(address string) *OpenChannelResponse
func (*OpenChannelEvent) Name ¶
func (oc *OpenChannelEvent) Name() string
func (*OpenChannelEvent) New ¶
func (oc *OpenChannelEvent) New() interface{}
func (*OpenChannelEvent) Reject ¶
func (oc *OpenChannelEvent) Reject(errorMessage string) *OpenChannelResponse
type OpenChannelResponse ¶
type OpenChannelResponse struct {
Result OpenChannelResult `json:"result"`
// Only allowed if result is "reject"
// Sent back to peer.
Message string `json:"error_message,omitempty"`
CloseToAddress string `json:"close_to,omitempty"`
}
type OpenChannelResult ¶
type OpenChannelResult string
const OcContinue OpenChannelResult = "continue"
const OcReject OpenChannelResult = "reject"
type OptionType ¶ added in v0.8.2
type OptionType string
type PayAttempt ¶
type PayAttempt struct {
Strategy string `json:"strategy"`
AgeInSeconds uint64 `json:"age_in_seconds"`
DurationInSeconds uint64 `json:"duration_in_seconds"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time,omitempty"`
ExcludedChannels []string `json:"excluded_channels,omitempty"`
Route []RouteHop `json:"route,omitempty"`
Failure PayAttemptFailure `json:"failure,omitempty"`
}
type PayAttemptFailure ¶
type PayAttemptFailure struct {
Code uint32 `json:"code"`
Message string `json:"message"`
Data PaymentErrorData `json:"data,omitempty"`
}
type PayFailure ¶
type PayFailure struct {
Message string `json:"message"`
Type string `json:"type"`
OnionReply string `json:"onionreply"`
ErringIndex int `json:"erring_index"`
FailCode int `json:"failcode"`
ErringNode string `json:"erring_node"`
ErringChannel string `json:"erring_channel"`
ChannelUpdate string `json:"channel_update"`
Route []RouteHop `json:"route"`
}
type PayRequest ¶
type PayRequest struct {
Bolt11 string `json:"bolt11"`
MilliSatoshi uint64 `json:"msatoshi,omitempty"`
Desc string `json:"description,omitempty"`
RiskFactor float32 `json:"riskfactor,omitempty"`
MaxFeePercent float32 `json:"maxfeeprecent,omitempty"`
RetryFor uint `json:"retry_for,omitempty"`
MaxDelay uint `json:"maxdelay,omitempty"`
ExemptFee bool `json:"exemptfee,omitempty"`
}
func (PayRequest) Name ¶
func (r PayRequest) Name() string
type PayStatus ¶
type PayStatus struct {
Bolt11 string `json:"bolt11"`
MilliSatoshi uint64 `json:"msatoshi"`
AmountMsat string `json:"amount_msat"`
Destination string `json:"destination"`
Attempts []PayAttempt `json:"attempts"`
}
type PayStatusRequest ¶
type PayStatusRequest struct {
Bolt11 string `json:"bolt11,omitempty"`
}
func (PayStatusRequest) Name ¶
func (r PayStatusRequest) Name() string
type PaymentError ¶
type PaymentError struct {
*jrpc2.RpcError
Data *PaymentErrorData
}
type PaymentErrorData ¶
type PaymentErrorData struct {
*PaymentFields
OnionReply string `json:"onionreply,omitempty"`
ErringIndex uint64 `json:"erring_index"`
FailCode int `json:"failcode"`
ErringNode string `json:"erring_node,omitempty"`
ErringChannel string `json:"erring_channel,omitempty"`
ErringDirection int `json:"erring_direction,omitempty"`
FailCodeName string `json:"failcodename,omitempty"`
RawMessage string `json:"raw_message,omitempty"`
}
type PaymentFields ¶
type PaymentSuccess ¶
type PaymentSuccess struct {
SendPayFields
GetRouteTries int `json:"getroute_tries"`
SendPayTries int `json:"sendpay_tries"`
Route []RouteHop `json:"route"`
Failures []PayFailure `json:"failures"`
}
todo: there's lots of different data that comes back for payment failures, that for now we totally lose
type PeerChannel ¶
type PeerChannel struct {
State string `json:"state"`
ScratchTxId string `json:"scratch_txid"`
Owner string `json:"owner"`
ShortChannelId string `json:"short_channel_id"`
ChannelDirection int `json:"direction"`
ChannelId string `json:"channel_id"`
FundingTxId string `json:"funding_txid"`
CloseToAddress string `json:"close_to_addr,omitempty"`
CloseToScript string `json:"close_to,omitempty"`
Status []string `json:"status"`
Private bool `json:"private"`
FundingAllocations map[string]uint64 `json:"funding_allocation_msat"`
FundingMsat map[string]string `json:"funding_msat"`
MilliSatoshiToUs uint64 `json:"msatoshi_to_us"`
ToUsMsat string `json:"to_us_msat"`
MilliSatoshiToUsMin uint64 `json:"msatoshi_to_us_min"`
MinToUsMsat string `json:"min_to_us_msat"`
MilliSatoshiToUsMax uint64 `json:"msatoshi_to_us_max"`
MaxToUsMsat string `json:"max_to_us_msat"`
MilliSatoshiTotal uint64 `json:"msatoshi_total"`
TotalMsat string `json:"total_msat"`
DustLimitSatoshi uint64 `json:"dust_limit_satoshis"`
DustLimitMsat string `json:"dust_limit_msat"`
MaxHtlcValueInFlightMilliSatoshi uint64 `json:"max_htlc_value_in_flight_msat"`
MaxHtlcValueInFlightMsat string `json:"max_total_htlc_in_msat"`
TheirChannelReserveSatoshi uint64 `json:"their_channel_reserve_satoshis"`
TheirReserveMsat string `json:"their_reserve_msat"`
OurChannelReserveSatoshi uint64 `json:"our_channel_reserve_satoshis"`
OurReserveMsat string `json:"our_reserve_msat"`
SpendableMilliSatoshi uint64 `json:"spendable_msatoshi"`
SpendableMsat string `json:"spendable_msat"`
ReceivableMilliSatoshi uint64 `json:"receivable_msatoshi"`
ReceivableMsat string `json:"receivable_msat"`
HtlcMinMilliSatoshi uint64 `json:"htlc_minimum_msat"`
MinimumHtlcInMsat string `json:"minimum_htlc_in_msat"`
TheirToSelfDelay uint `json:"their_to_self_delay"`
OurToSelfDelay uint `json:"our_to_self_delay"`
MaxAcceptedHtlcs uint `json:"max_accepted_htlcs"`
InPaymentsOffered uint64 `json:"in_payments_offered"`
InMilliSatoshiOffered uint64 `json:"in_msatoshi_offered"`
IncomingOfferedMsat string `json:"in_offered_msat"`
InPaymentsFulfilled uint64 `json:"in_payments_fulfilled"`
InMilliSatoshiFulfilled uint64 `json:"in_msatoshi_fulfilled"`
IncomingFulfilledMsat string `json:"in_fulfilled_msat"`
OutPaymentsOffered uint64 `json:"out_payments_offered"`
OutMilliSatoshiOffered uint64 `json:"out_msatoshi_offered"`
OutgoingOfferedMsat string `json:"out_offered_msat"`
OutPaymentsFulfilled uint64 `json:"out_payments_fulfilled"`
OutMilliSatoshiFulfilled uint64 `json:"out_msatoshi_fulfilled"`
OutgoingFulfilledMsat string `json:"out_fulfilled_msat"`
Htlcs []*Htlc `json:"htlcs"`
}
type PeerConnectedEvent ¶
type PeerConnectedEvent struct {
Peer PeerEvent `json:"peer"`
// contains filtered or unexported fields
}
This hook is called whenever a peer has connected and successfully completed
the cryptographic handshake. The parameters have the following structure if there is a channel with the peer:
func (*PeerConnectedEvent) Continue ¶
func (pc *PeerConnectedEvent) Continue() *PeerConnectedResponse
func (*PeerConnectedEvent) Disconnect ¶
func (pc *PeerConnectedEvent) Disconnect(errMsg string) *PeerConnectedResponse
func (*PeerConnectedEvent) Name ¶
func (pc *PeerConnectedEvent) Name() string
func (*PeerConnectedEvent) New ¶
func (pc *PeerConnectedEvent) New() interface{}
type PeerConnectedResponse ¶
type PeerConnectedResponse struct {
Result _PeerConnectedResult `json:"result"`
ErrorMessage string `json:"error_message,omitempty"`
}
type PingRequest ¶
type PingRequest struct {
Id string `json:"id"`
Len uint `json:"len"`
PongBytes uint `json:"pongbytes"`
}
func (PingRequest) Name ¶
func (r PingRequest) Name() string
type Plugin ¶
type Plugin struct {
Config *Config
// contains filtered or unexported fields
}
func (*Plugin) AddChannelFeatures ¶ added in v0.8.2
func (*Plugin) AddInitFeatures ¶ added in v0.8.1
func (*Plugin) AddInvoiceFeatures ¶ added in v0.8.1
func (*Plugin) AddNodeFeatures ¶ added in v0.8.1
func (*Plugin) GetBoolOption ¶ added in v0.8.2
func (*Plugin) GetIntOption ¶ added in v0.8.2
func (*Plugin) IsOptionFlagged ¶ added in v0.8.2
func (*Plugin) RegisterHooks ¶
func (*Plugin) RegisterMethod ¶
func (*Plugin) RegisterNewBoolOption ¶ added in v0.8.2
func (*Plugin) RegisterNewFlagOption ¶ added in v0.8.2
func (*Plugin) RegisterNewIntOption ¶ added in v0.8.2
func (*Plugin) RegisterNewOption ¶ added in v0.8.1
func (*Plugin) RegisterOption ¶
func (*Plugin) SetDynamic ¶
func (*Plugin) SubscribeChannelOpened ¶
func (p *Plugin) SubscribeChannelOpened(cb func(c *ChannelOpened))
func (*Plugin) SubscribeConnect ¶
func (p *Plugin) SubscribeConnect(cb func(c *ConnectEvent))
func (*Plugin) SubscribeDisconnect ¶
func (p *Plugin) SubscribeDisconnect(cb func(c *DisconnectEvent))
func (*Plugin) SubscribeForwardings ¶
func (p *Plugin) SubscribeForwardings(cb func(c *Forwarding))
func (*Plugin) SubscribeInvoicePaid ¶
func (*Plugin) SubscribeSendPayFailure ¶ added in v0.8.0
func (p *Plugin) SubscribeSendPayFailure(cb func(c *SendPayFailure))
func (*Plugin) SubscribeSendPaySuccess ¶ added in v0.8.0
func (p *Plugin) SubscribeSendPaySuccess(cb func(c *SendPaySuccess))
func (*Plugin) SubscribeWarnings ¶
func (*Plugin) UnregisterMethod ¶
func (*Plugin) UnregisterOption ¶
type PluginInfo ¶
type PluginRequest ¶
type PluginRequest struct {
Subcommand string `json:"subcommand"`
}
func (*PluginRequest) Name ¶
func (r *PluginRequest) Name() string
type PluginRequestDir ¶
type PluginRequestDir struct {
Subcommand string `json:"subcommand"`
Directory string `json:"directory"`
}
func (*PluginRequestDir) Name ¶
func (r *PluginRequestDir) Name() string
type PluginRequestPlugin ¶
type PluginRequestPlugin struct {
Subcommand string `json:"subcommand"`
PluginName string `json:"plugin"`
}
func (*PluginRequestPlugin) Name ¶
func (r *PluginRequestPlugin) Name() string
type QueryShortChannelIdsResponse ¶
type QueryShortChannelIdsResponse struct {
IsComplete bool `json:"complete"`
}
type RouteRequest ¶
type RouteRequest struct {
PeerId string `json:"id"`
MilliSatoshis uint64 `json:"msatoshi"`
RiskFactor float32 `json:"riskfactor"`
Cltv uint `json:"cltv"`
FromId string `json:"fromid,omitempty"`
FuzzPercent float32 `json:"fuzzpercent"`
Seed string `json:"seed,omitempty"`
Exclude []string `json:"exclude,omitempty"`
MaxHops int32 `json:"maxhops,omitempty"`
}
func (RouteRequest) Name ¶
func (rr RouteRequest) Name() string
type RpcCmd ¶ added in v0.8.0
type RpcCmd struct {
ParsedId json.RawMessage `json:"id"`
MethodName string `json:"method"`
RawParams json.RawMessage `json:"params"`
// contains filtered or unexported fields
}
type RpcCommandEvent ¶ added in v0.8.0
type RpcCommandEvent struct {
Cmd RpcCmd `json:"rpc_command"`
// contains filtered or unexported fields
}
func (*RpcCommandEvent) Call ¶ added in v0.8.0
func (rc *RpcCommandEvent) Call() (jrpc2.Result, error)
func (*RpcCommandEvent) Continue ¶ added in v0.8.0
func (rc *RpcCommandEvent) Continue() *RpcCommandResponse
func (*RpcCommandEvent) Name ¶ added in v0.8.0
func (rc *RpcCommandEvent) Name() string
func (*RpcCommandEvent) New ¶ added in v0.8.0
func (rc *RpcCommandEvent) New() interface{}
func (*RpcCommandEvent) ReplaceWith ¶ added in v0.8.0
func (rc *RpcCommandEvent) ReplaceWith(m jrpc2.Method) *RpcCommandResponse
Replace the existing command with a new command. for usability reasons, we unilaterally reuse the id of the original command
func (*RpcCommandEvent) ReturnError ¶ added in v0.8.0
func (rc *RpcCommandEvent) ReturnError(errMsg string, errCode int) (*RpcCommandResponse, error)
func (*RpcCommandEvent) ReturnResult ¶ added in v0.8.0
func (rc *RpcCommandEvent) ReturnResult(resp RpcCommand_Return) (*RpcCommandResponse, error)
type RpcCommandResponse ¶ added in v0.8.0
type RpcCommandResponse struct {
// deprecated in v0.8.1
Continue *bool `json:"continue,omitempty"`
Result _RpcCommand_Result `json:"result,omitempty"`
ReplaceObj *jrpc2.Request `json:"replace,omitempty"`
ReturnObj json.RawMessage `json:"return,omitempty"`
}
the result can be any of the following. providing more than one's behavior is undefined. the API around this should protect you from that, however
type RpcCommand_Return ¶ added in v0.8.0
type RpcCommand_Return interface{}
type RpcMethod ¶
type RpcMethod struct {
Method jrpc2.ServerMethod
Desc string
LongDesc string
Category string
}
func NewInitRpcMethod ¶
func NewManifestRpcMethod ¶
func NewRpcMethod ¶
func NewRpcMethod(method jrpc2.ServerMethod, desc string) *RpcMethod
func (*RpcMethod) Description ¶
func (*RpcMethod) MarshalJSON ¶
type Sat ¶ added in v0.8.1
func ConvertBtc ¶ added in v0.8.1
func (*Sat) ConvertMsat ¶ added in v0.8.1
type SendOnionRequest ¶ added in v0.8.0
type SendOnionRequest struct {
Onion string `json:"onion"`
FirstHop FirstHop `json:"first_hop"`
PaymentHash string `json:"payment_hash"`
Label string `json:"label,omitempty"`
// For MPP payments!
PartId uint64 `json:"partid,omitempty"`
}
func (SendOnionRequest) Name ¶ added in v0.8.0
func (r SendOnionRequest) Name() string
type SendPayFailure ¶ added in v0.8.0
type SendPayFailure struct {
Code int `json:"code"`
Message string `json:"message"`
Data SendPayFailureData `json:"data"`
}
type SendPayFailureData ¶ added in v0.8.0
type SendPayFailureData struct {
Id int `json:"id"`
PaymentHash string `json:"payment_hash"`
Destination string `json:"destination"`
MilliSatoshi uint64 `json:"msatoshi"`
AmountMilliSatoshi string `json:"amount_msat"`
AmountSent uint64 `json:"msatoshi_sent"`
AmountSentMilliSatoshi string `json:"amount_sent_msat"`
Status string `json:"status"`
CreatedAt uint64 `json:"created_at"`
ErringIndex uint64 `json:"erring_index"`
FailCode int `json:"failcode"`
ErringNode string `json:"erring_node"`
ErringChannel string `json:"erring_channel"`
ErringDirection int `json:"erring_direction"`
FailCodeName string `json:"failcodename"`
}
type SendPayFailureEvent ¶ added in v0.8.0
type SendPayFailureEvent struct {
SendPayFailure *SendPayFailure `json:"sendpay_failure"`
// contains filtered or unexported fields
}
func (*SendPayFailureEvent) Call ¶ added in v0.8.0
func (e *SendPayFailureEvent) Call() (jrpc2.Result, error)
func (*SendPayFailureEvent) Name ¶ added in v0.8.0
func (e *SendPayFailureEvent) Name() string
func (*SendPayFailureEvent) New ¶ added in v0.8.0
func (e *SendPayFailureEvent) New() interface{}
type SendPayFields ¶
type SendPayFields struct {
Id uint64 `json:"id"`
PaymentHash string `json:"payment_hash"`
Destination string `json:"destination,omitempty"`
AmountMilliSatoshiRaw uint64 `json:"msatoshi,omitempty"`
AmountMilliSatoshi string `json:"amount_msat"`
MilliSatoshiSentRaw uint64 `json:"msatoshi_sent"`
MilliSatoshiSent string `json:"amount_sent_msat"`
CreatedAt float64 `json:"created_at"`
Status string `json:"status"`
PaymentPreimage string `json:"payment_preimage,omitempty"`
Label string `json:"label,omitempty"`
Bolt11 string `json:"bolt11,omitempty"`
PartId uint64 `json:"partid,omitempty"`
ErrorOnion string `json:"erroronion,omitempty"`
}
type SendPayRequest ¶
type SendPayRequest struct {
Route []RouteHop `json:"route"`
PaymentHash string `json:"payment_hash"`
Label string `json:"label,omitempty"`
MilliSatoshis *uint64 `json:"msatoshi,omitempty"`
Bolt11 string `json:"bolt11,omitempty"`
PaymentSecret string `json:"payment_secret,omitempty"`
PartId uint64 `json:"partid,omitempty"`
}
func (SendPayRequest) Name ¶
func (r SendPayRequest) Name() string
type SendPayResult ¶
type SendPayResult struct {
Message string `json:"message"`
SendPayFields
}
type SendPaySuccess ¶ added in v0.8.0
type SendPaySuccess struct {
Id uint `json:"id"`
PaymentHash string `json:"payment_hash"`
Destination string `json:"destination"`
MilliSatoshi uint64 `json:"msatoshi"`
AmountMilliSatoshi string `json:"amount_msat"`
AmountSent uint64 `json:"msatoshi_sent"`
AmountSentMilliSatoshi string `json:"amount_sent_msat"`
CreatedAt float64 `json:"created_at"`
Status string `json:"status"`
PaymentPreimage string `json:"payment_preimage"`
}
type SendPaySuccessEvent ¶ added in v0.8.0
type SendPaySuccessEvent struct {
SendPaySuccess *SendPaySuccess `json:"sendpay_success"`
// contains filtered or unexported fields
}
func (*SendPaySuccessEvent) Call ¶ added in v0.8.0
func (e *SendPaySuccessEvent) Call() (jrpc2.Result, error)
func (*SendPaySuccessEvent) Name ¶ added in v0.8.0
func (e *SendPaySuccessEvent) Name() string
func (*SendPaySuccessEvent) New ¶ added in v0.8.0
func (e *SendPaySuccessEvent) New() interface{}
type SetChannelFeeRequest ¶
type SetChannelFeeRequest struct {
Id string `json:"id"`
BaseMilliSatoshis string `json:"base,omitempty"`
PartPerMillion uint32 `json:"ppm,omitempty"`
}
func (*SetChannelFeeRequest) Name ¶
func (r *SetChannelFeeRequest) Name() string
type SharedSecretRequest ¶ added in v0.8.2
type SharedSecretRequest struct {
}
func (*SharedSecretRequest) Name ¶ added in v0.8.2
func (r *SharedSecretRequest) Name() string
type SharedSecretResp ¶ added in v0.8.2
type SharedSecretResp struct {
}
type SignMessageRequest ¶ added in v0.8.0
type SignMessageRequest struct {
Message string `json:"message"`
}
func (SignMessageRequest) Name ¶ added in v0.8.0
func (r SignMessageRequest) Name() string
type SignedMessage ¶ added in v0.8.0
type StartResponse ¶ added in v0.8.0
type StopRequest ¶
type StopRequest struct{}
func (StopRequest) Name ¶
func (r StopRequest) Name() string
type StringOption ¶ added in v0.8.2
type StringOption struct {
Name string
Default string
Val string
// contains filtered or unexported fields
}
func NewOption ¶
func NewOption(name, desc, defaultValue string) *StringOption
func NewStringOption ¶ added in v0.8.2
func NewStringOption(name, description, defaultValue string) *StringOption
func (*StringOption) GetDefault ¶ added in v0.8.2
func (o *StringOption) GetDefault() interface{}
func (*StringOption) GetDesc ¶ added in v0.8.2
func (o *StringOption) GetDesc() string
func (*StringOption) GetName ¶ added in v0.8.2
func (o *StringOption) GetName() string
func (*StringOption) GetValue ¶ added in v0.8.2
func (o *StringOption) GetValue() interface{}
func (*StringOption) MarshalJSON ¶ added in v0.8.2
func (o *StringOption) MarshalJSON() ([]byte, error)
func (*StringOption) Set ¶ added in v0.8.2
func (o *StringOption) Set(value interface{}) error
func (*StringOption) Type ¶ added in v0.8.2
func (o *StringOption) Type() string
type Subscription ¶
type Subscription string
type Transaction ¶ added in v0.8.0
type Transaction struct {
Hash string `json:"hash"`
RawTx string `json:"rawtx"`
Blockheight uint `json:"blockheight"`
TxIndex uint `json:"txindex"`
LockTime uint64 `json:"locktime"`
Version uint `json:"version"`
Inputs []TxInput `json:"inputs"`
Outputs []TxOutput `json:"outputs"`
Type []string `json:"type,omitempty"`
}
type TransactionsRequest ¶ added in v0.8.0
type TransactionsRequest struct {
}
func (TransactionsRequest) Name ¶ added in v0.8.0
func (r TransactionsRequest) Name() string
type TxPrepare ¶
type TxPrepare struct {
Outputs []json.RawMessage `json:"outputs"`
FeeRate string `json:"feerate,omitempty"`
MinConf uint16 `json:"minconf,omitempty"`
Utxos []string `json:"utxos,omitempty"`
}
type WaitAnyInvoiceRequest ¶
type WaitAnyInvoiceRequest struct {
LastPayIndex uint `json:"lastpay_index,omitempty"`
Timeout *uint `json:"timeout,omitempty"`
}
func (WaitAnyInvoiceRequest) Name ¶
func (r WaitAnyInvoiceRequest) Name() string
type WaitInvoiceRequest ¶
type WaitInvoiceRequest struct {
Label string `json:"label"`
}
func (WaitInvoiceRequest) Name ¶
func (r WaitInvoiceRequest) Name() string
type WaitSendPayRequest ¶
type WaitSendPayRequest struct {
PaymentHash string `json:"payment_hash"`
Timeout uint `json:"timeout,omitempty"`
PartId uint64 `json:"partid,omitempty"`
}
func (WaitSendPayRequest) Name ¶
func (r WaitSendPayRequest) Name() string
type WarnEvent ¶
type WarnEvent struct {
Warning Warning `json:"warning"`
// contains filtered or unexported fields
}
type WithdrawRequest ¶
type WithdrawRequest struct {
Destination string `json:"destination"`
Satoshi string `json:"satoshi"`
FeeRate string `json:"feerate,omitempty"`
MinConf uint16 `json:"minconf,omitempty"`
Utxos []string `json:"utxos,omitempty"`
}
func (WithdrawRequest) Name ¶
func (r WithdrawRequest) Name() string