Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertAmount(s string) uint64
- func ConvertFeatures(features string) map[string]NodeFeatureAPI
- func FromLndChanID(chanID uint64) string
- func GetClient(getData GetDataCall) (lnrpc.LightningClient, routerrpc.RouterClient, func(), error)
- func GetConnection(getData GetDataCall) (*grpc.ClientConn, error)
- func IsMacaroonValid(mac *macaroon.Macaroon) (bool, time.Duration)
- func SumCapacityExtended(channels []NodeChannelAPIExtended) uint64
- func SumCapacitySimple(channels []NodeChannelAPI) uint64
- func ToLndChanID(id string) (uint64, error)
- type API
- type APIType
- type CertificateVerification
- type ChannelAPI
- type ChannelConstraintsOverride
- type ChannelOverride
- type Channels
- type ChannelsAPI
- type ClnCommandoConnection
- type ClnCommandoLightningAPI
- type ClnConnection
- type ClnConnectionAPI
- type ClnErrorResp
- type ClnFeatures
- type ClnForwardEntries
- type ClnForwardEntry
- type ClnFundsChan
- type ClnFundsChanResp
- type ClnInfo
- type ClnListChan
- type ClnListChanResp
- type ClnListNode
- type ClnListNodeAddr
- type ClnListNodeResp
- type ClnRawForwardEntries
- type ClnRawForwardsTime
- type ClnRawInvoiceTime
- type ClnRawInvoices
- type ClnRawLightningAPI
- func (l *ClnRawLightningAPI) Cleanup()
- func (l *ClnRawLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *ClnRawLightningAPI) GetAPIType() APIType
- func (l *ClnRawLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *ClnRawLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *ClnRawLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *ClnRawLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
- func (l *ClnRawLightningAPI) GetInternalChannels(ctx context.Context, pubKey string) (map[string][]ClnListChan, error)
- func (l *ClnRawLightningAPI) GetInternalChannelsAll(ctx context.Context) (map[string][]ClnListChan, error)
- func (l *ClnRawLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
- func (l *ClnRawLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *ClnRawLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
- func (l *ClnRawLightningAPI) GetNodeInfoFull(ctx context.Context, channels bool, unannounced bool) (*NodeInfoAPIExtended, error)
- func (l *ClnRawLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
- func (l *ClnRawLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *ClnRawLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
- type ClnRawMessageItf
- type ClnRawPayTime
- type ClnRawPayments
- type ClnRawTimeItf
- type ClnResp
- type ClnSetChan
- type ClnSetChanResp
- type ClnSocketLightningAPI
- type ClnSuccessResp
- type ClnUnixConnection
- type DescribeGraphAPI
- type DescribeGraphNodeAPI
- type ErrorData
- type ForwardingEvent
- type ForwardingEventOverride
- type ForwardingHistoryRequestOverride
- type ForwardingHistoryResponseOverride
- type GetDataCall
- type GetDoFunc
- type GetInfoResponseOverride
- type GetNodeInfoOverride
- type Graph
- type GraphEdgeOverride
- type GraphNodeOverride
- type HTLCAttempt
- type HTLCAttemptOverride
- type HTLCStatus
- type HTTPAPI
- func (h *HTTPAPI) Do(req *http.Request) (*http.Response, error)
- func (h *HTTPAPI) GetHTTPRequest(getData GetDataCall) (*http.Request, *http.Transport, error)
- func (h *HTTPAPI) HTTPForwardEvents(ctx context.Context, req *http.Request, ...) (*ForwardingHistoryResponseOverride, error)
- func (h *HTTPAPI) HTTPGetChanInfo(ctx context.Context, req *http.Request, chanID uint64) (*GraphEdgeOverride, error)
- func (h *HTTPAPI) HTTPGetChannels(ctx context.Context, req *http.Request) (*Channels, error)
- func (h *HTTPAPI) HTTPGetGraph(ctx context.Context, req *http.Request, unannounced bool) (*Graph, error)
- func (h *HTTPAPI) HTTPGetInfo(ctx context.Context, req *http.Request) (*GetInfoResponseOverride, error)
- func (h *HTTPAPI) HTTPGetNodeInfo(ctx context.Context, req *http.Request, pubKey string, channels bool) (*GetNodeInfoOverride, error)
- func (h *HTTPAPI) HTTPListInvoices(ctx context.Context, req *http.Request, input *ListInvoiceRequestOverride) (*ListInvoiceResponseOverride, error)
- func (h *HTTPAPI) HTTPListPayments(ctx context.Context, req *http.Request, input *ListPaymentsRequestOverride) (*ListPaymentsResponseOverride, error)
- func (h *HTTPAPI) HTTPSubscribeHtlcEvents(ctx context.Context, req *http.Request) (<-chan *HtlcEventOverride, error)
- func (h *HTTPAPI) SetTransport(transport *http.Transport)
- type Hop
- type HopHintOverride
- type HopOverride
- type HtlcAPI
- type HtlcEventComposite
- type HtlcEventOverride
- type HtlcInfoOverride
- type HtlcOverride
- type InfoAPI
- type Invoice
- type InvoiceHTLCState
- type InvoiceOverride
- type InvoicesResponse
- type LightingAPICalls
- func NewAPI(apiType APIType, getData GetDataCall) LightingAPICalls
- func NewClnCommandoLightningAPI(getData GetDataCall) LightingAPICalls
- func NewClnCommandoLightningAPIRaw(addr, rune string) LightingAPICalls
- func NewClnSocketLightningAPI(getData GetDataCall) LightingAPICalls
- func NewClnSocketLightningAPIRaw(socketType string, address string) LightingAPICalls
- func NewLndGrpcLightningAPI(getData GetDataCall) LightingAPICalls
- func NewLndRestLightningAPI(getData GetDataCall) LightingAPICalls
- type ListInvoiceRequestOverride
- type ListInvoiceResponseOverride
- type ListPaymentsRequestOverride
- type ListPaymentsResponseOverride
- type LndGrpcLightningAPI
- func (l *LndGrpcLightningAPI) Cleanup()
- func (l *LndGrpcLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *LndGrpcLightningAPI) GetAPIType() APIType
- func (l *LndGrpcLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *LndGrpcLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *LndGrpcLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndGrpcLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
- func (l *LndGrpcLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
- func (l *LndGrpcLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndGrpcLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
- func (l *LndGrpcLightningAPI) GetNodeInfoFull(ctx context.Context, channels, unnanounced bool) (*NodeInfoAPIExtended, error)
- func (l *LndGrpcLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
- func (l *LndGrpcLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndGrpcLightningAPI) SubscribeFailedForwards(ctx context.Context, outchan chan RawMessage) error
- func (l *LndGrpcLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
- type LndRestLightningAPI
- func (l *LndRestLightningAPI) Cleanup()
- func (l *LndRestLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *LndRestLightningAPI) GetAPIType() APIType
- func (l *LndRestLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *LndRestLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *LndRestLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndRestLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
- func (l *LndRestLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
- func (l *LndRestLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndRestLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
- func (l *LndRestLightningAPI) GetNodeInfoFull(ctx context.Context, channels, unnanounced bool) (*NodeInfoAPIExtended, error)
- func (l *LndRestLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
- func (l *LndRestLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
- func (l *LndRestLightningAPI) SubscribeFailedForwards(ctx context.Context, outchan chan RawMessage) error
- func (l *LndRestLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
- type NodeAddressAPI
- type NodeChannelAPI
- type NodeChannelAPIExtended
- type NodeFeatureAPI
- type NodeInfoAPI
- type NodeInfoAPIExtended
- type Pagination
- type Payment
- type PaymentFailureReason
- type PaymentOverride
- type PaymentStatus
- type PaymentsResponse
- type RawMessage
- type RawPagination
- type ResponseForwardPagination
- type ResponsePagination
- type ResponseRawPagination
- type Route
- type RouteHintOverride
- type RouteOverride
- type RoutingPolicyAPI
- type RoutingPolicyOverride
Constants ¶
const ( LISTCHANNELS = "listchannels" LISTNODES = "listnodes" LISTFUNDS = "listfunds" GETINFO = "getinfo" LISTFORWARDS = "listforwards" LISTINVOICES = "listinvoices" LISTPAYMENTS = "listsendpays" )
Method names
Variables ¶
Functions ¶
func ConvertAmount ¶
ConvertAmount - converts string amount to satoshis
func ConvertFeatures ¶
func ConvertFeatures(features string) map[string]NodeFeatureAPI
ConvertFeatures - convert bitmask to LND like feature map
func FromLndChanID ¶
FromLndChanID - converts from LND to CLN channel id
func GetClient ¶
func GetClient(getData GetDataCall) (lnrpc.LightningClient, routerrpc.RouterClient, func(), error)
GetClient - get a lightning API client
func GetConnection ¶
func GetConnection(getData GetDataCall) (*grpc.ClientConn, error)
GetConnection - returns a GRPC client connection
func IsMacaroonValid ¶
IsMacaroonValid - verify whether macaroon is valid
func SumCapacityExtended ¶
func SumCapacityExtended(channels []NodeChannelAPIExtended) uint64
SumCapacityExtended - get sum of channel capacity
func SumCapacitySimple ¶
func SumCapacitySimple(channels []NodeChannelAPI) uint64
SumCapacitySimple - get sum of channel capacity
func ToLndChanID ¶
ToLndChanID - converts from CLN to LND channel id
Types ¶
type API ¶ added in v0.0.42
type API struct { Name string GetNodeInfoFullThreshUseDescribeGraph int // If node has more than that number of channels use DescribeGraph else do GetChanInfo for each one }
API - generic API settings
func (*API) GetDefaultBatchSize ¶ added in v0.0.42
GetDefaultBatchSize returns the default batch size
type CertificateVerification ¶
type CertificateVerification int
CertificateVerification enum
const ( PublicCAorCert CertificateVerification = iota PublicCA AllowWhenPubKeySame Strict Insecure SkipHostVerification )
Verification types
type ChannelAPI ¶
type ChannelAPI struct { Private bool Active bool RemotePubkey string Initiator bool CommitFee uint64 ChanID uint64 RemoteBalance uint64 LocalBalance uint64 Capacity uint64 PendingHtlcs []HtlcAPI TotalSatoshisSent uint64 TotalSatoshisReceived uint64 NumUpdates uint64 }
ChannelAPI struct
type ChannelConstraintsOverride ¶
type ChannelConstraintsOverride struct { ChanReserveSat string `json:"chan_reserve_sat,omitempty"` DustLimitSat string `json:"dust_limit_sat,omitempty"` MaxPendingAmtMsat string `json:"max_pending_amt_msat,omitempty"` MinHtlcMsat string `json:"min_htlc_msat,omitempty"` lnrpc.ChannelConstraints }
ChannelConstraintsOverride struct
type ChannelOverride ¶
type ChannelOverride struct { ChanID string `json:"chan_id,omitempty"` Capacity string `json:"capacity,omitempty"` LocalBalance string `json:"local_balance,omitempty"` RemoteBalance string `json:"remote_balance,omitempty"` CommitFee string `json:"commit_fee,omitempty"` CommitWeight string `json:"commit_weight,omitempty"` FeePerKw string `json:"fee_per_kw,omitempty"` UnsettledBalance string `json:"unsettled_balance,omitempty"` TotalSatoshisSent string `json:"total_satoshis_sent,omitempty"` TotalSatoshisReceived string `json:"total_satoshis_received,omitempty"` NumUpdates string `json:"num_updates,omitempty"` // Deprecated LocalChanReserveSat string `json:"local_chan_reserve_sat,omitempty"` // Deprecated RemoteChanReserveSat string `json:"remote_chan_reserve_sat,omitempty"` CommitmentType string `json:"commitment_type,omitempty"` PendingHtlcs []*HtlcOverride `json:"pending_htlcs,omitempty"` Lifetime string `json:"lifetime,omitempty"` Uptime string `json:"uptime,omitempty"` PushAmountSat string `json:"push_amount_sat,omitempty"` LocalConstraints *ChannelConstraintsOverride `json:"local_constraints,omitempty"` RemoteConstraints *ChannelConstraintsOverride `json:"remote_constraints,omitempty"` AliasScids []string `json:"alias_scids,omitempty"` ZeroConfConfirmedScid string `json:"zero_conf_confirmed_scid,omitempty"` lnrpc.Channel }
ChannelOverride struct
type Channels ¶
type Channels struct {
Channels []*ChannelOverride `json:"channels"`
}
Channels struct
type ClnCommandoConnection ¶ added in v0.0.44
type ClnCommandoConnection struct { ClnConnection // contains filtered or unexported fields }
ClnCommandoConnection struct
func NewCommandoConnection ¶ added in v0.0.44
func NewCommandoConnection(addr string, rune string, timeout time.Duration) *ClnCommandoConnection
NewCommandoConnection creates a new CLN connection
func (*ClnCommandoConnection) Call ¶ added in v0.0.44
func (l *ClnCommandoConnection) Call(ctx context.Context, serviceMethod string, args any, reply any) error
Call calls serviceMethod with args and fills reply with response
func (*ClnCommandoConnection) Cleanup ¶ added in v0.0.46
func (l *ClnCommandoConnection) Cleanup()
Cleanup does the cleanup
func (*ClnCommandoConnection) StreamResponse ¶ added in v0.0.44
func (l *ClnCommandoConnection) StreamResponse(ctx context.Context, serviceMethod string, args any) (io.Reader, error)
StreamResponse is meant for streaming responses it calls serviceMethod with args and returns an io.Reader
type ClnCommandoLightningAPI ¶ added in v0.0.44
type ClnCommandoLightningAPI struct {
ClnRawLightningAPI
}
ClnCommandoLightningAPI struct
type ClnConnectionAPI ¶ added in v0.0.44
type ClnConnectionAPI interface { // Call calls serviceMethod with args and fills reply with response Call(ctx context.Context, serviceMethod string, args any, reply any) error // StreamResponse is meant for streaming responses it calls serviceMethod with args and returns an io.Reader StreamResponse(ctx context.Context, serviceMethod string, args any) (io.Reader, error) // Cleanup does the cleanup Cleanup() }
ClnConnectionAPI interface
type ClnErrorResp ¶ added in v0.0.44
type ClnErrorResp struct { ClnResp Error struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` } `json:"error"` }
ClnErrorResp struct
type ClnFeatures ¶
type ClnFeatures struct { Init string `json:"init"` Node string `json:"node"` Channel string `json:"channe"` Invoice string `json:"invoice"` }
ClnFeatures struct
type ClnForwardEntries ¶ added in v0.0.42
type ClnForwardEntries struct {
Entries []ClnForwardEntry `json:"forwards,omitempty"`
}
ClnForwardEntries struct
type ClnForwardEntry ¶ added in v0.0.42
type ClnForwardEntry struct { InChannel string `json:"in_channel"` InMsat string `json:"in_msat"` Status string `json:"status"` // one of "offered", "settled", "local_failed", "failed" ReceivedTime entities.JsonTime `json:"received_time"` OutChannel string `json:"out_channel,omitempty"` OutMsat string `json:"out_msat,omitempty"` FeeMsat string `json:"fee_msat,omitempty"` FailCode uint32 `json:"fail_code,omitempty"` FailReason string `json:"fail_reason,omitempty"` }
ClnForwardEntry struct
type ClnFundsChan ¶
type ClnFundsChan struct { PeerID string `json:"peer_id"` Connected bool `json:"connected,omitempty"` ShortChannelID string `json:"short_channel_id"` State string `json:"state"` Capacity uint64 `json:"channel_total_sat"` OurAmount uint64 `json:"channel_sat"` FundingTxID string `json:"funding_txid"` FundingOutput int `json:"funding_output"` }
ClnFundsChan struct
type ClnFundsChanResp ¶
type ClnFundsChanResp struct { Channels []ClnFundsChan `json:"channels,omitempty"` ClnResp }
ClnFundsChanResp struct
type ClnInfo ¶
type ClnInfo struct { PubKey string `json:"id"` Alias string `json:"alias"` Color string `json:"color"` Network string `json:"network"` Addresses []ClnListNodeAddr `json:"address,omitempty"` Features ClnFeatures `json:"our_features"` Version string `json:"version"` WarningBitcoindSync string `json:"warning_bitcoind_sync,omitempty"` WarningLightningdSync string `json:"warning_lightningd_sync,omitempty"` }
ClnInfo struct
type ClnListChan ¶
type ClnListChan struct { Source string `json:"source"` Destination string `json:"destination"` Public bool `json:"public"` Capacity uint64 `json:"satoshis"` Active bool `json:"active"` LastUpdate entities.JsonTime `json:"last_update"` FeeBase uint64 `json:"base_fee_millisatoshi"` FeePpm uint64 `json:"fee_per_millionth"` MinHtlc string `json:"htlc_minimum_msat"` MaxHtlc string `json:"htlc_maximum_msat"` ShortChannelID string `json:"short_channel_id,omitempty"` Delay uint64 `json:"delay"` }
ClnListChan struct
type ClnListChanResp ¶
type ClnListChanResp struct { Channels []ClnListChan `json:"channels,omitempty"` ClnResp }
ClnListChanResp struct
type ClnListNode ¶
type ClnListNode struct { PubKey string `json:"nodeid"` Alias string `json:"alias,omitempty"` Color string `json:"color,omitempty"` Features string `json:"features,omitempty"` Addresses []ClnListNodeAddr `json:"addresses,omitempty"` LastUpdate *entities.JsonTime `json:"last_update,omitempty"` }
ClnListNode struct
type ClnListNodeAddr ¶
type ClnListNodeAddr struct { Type string `json:"type"` Address string `json:"address"` Port int `json:"port"` }
ClnListNodeAddr struct
type ClnListNodeResp ¶
type ClnListNodeResp struct { Nodes []ClnListNode `json:"nodes,omitempty"` ClnResp }
ClnListNodeResp struct
type ClnRawForwardEntries ¶ added in v0.0.42
type ClnRawForwardEntries struct {
Entries []json.RawMessage `json:"forwards,omitempty"`
}
ClnRawForwardEntries struct
func (ClnRawForwardEntries) GetEntries ¶ added in v0.0.42
func (r ClnRawForwardEntries) GetEntries() []json.RawMessage
GetEntries to comply with ClnRawMessageItf
type ClnRawForwardsTime ¶ added in v0.0.42
type ClnRawForwardsTime struct {
Time float64 `json:"received_time,omitempty"`
}
ClnRawForwardsTime struct
func (ClnRawForwardsTime) GetUnixTimeMs ¶ added in v0.0.43
func (r ClnRawForwardsTime) GetUnixTimeMs() uint64
GetUnixTimeMs to comply with ClnRawTimeItf
type ClnRawInvoiceTime ¶ added in v0.0.42
type ClnRawInvoiceTime struct {
Time uint64 `json:"expires_at,omitempty"`
}
ClnRawInvoiceTime struct
func (ClnRawInvoiceTime) GetUnixTimeMs ¶ added in v0.0.43
func (r ClnRawInvoiceTime) GetUnixTimeMs() uint64
GetUnixTimeMs to comply with ClnRawTimeItf
type ClnRawInvoices ¶ added in v0.0.42
type ClnRawInvoices struct {
Entries []json.RawMessage `json:"invoices,omitempty"`
}
ClnRawInvoices struct
func (ClnRawInvoices) GetEntries ¶ added in v0.0.42
func (r ClnRawInvoices) GetEntries() []json.RawMessage
GetEntries to comply with ClnRawMessageItf
type ClnRawLightningAPI ¶ added in v0.0.44
type ClnRawLightningAPI struct { API // contains filtered or unexported fields }
ClnRawLightningAPI struct
func (*ClnRawLightningAPI) Cleanup ¶ added in v0.0.44
func (l *ClnRawLightningAPI) Cleanup()
Cleanup - clean up API
func (*ClnRawLightningAPI) DescribeGraph ¶ added in v0.0.44
func (l *ClnRawLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph - DescribeGraph API call
func (*ClnRawLightningAPI) GetAPIType ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetAPIType() APIType
GetAPIType - API call
func (*ClnRawLightningAPI) GetChanInfo ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
GetChanInfo - GetChanInfo API call
func (*ClnRawLightningAPI) GetChannels ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
GetChannels - GetChannels API call
func (*ClnRawLightningAPI) GetForwardsRaw ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetForwardsRaw - API call
func (*ClnRawLightningAPI) GetInfo ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo - GetInfo API call
func (*ClnRawLightningAPI) GetInternalChannels ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetInternalChannels(ctx context.Context, pubKey string) (map[string][]ClnListChan, error)
GetInternalChannels - internal method to get channels
func (*ClnRawLightningAPI) GetInternalChannelsAll ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetInternalChannelsAll(ctx context.Context) (map[string][]ClnListChan, error)
GetInternalChannelsAll - internal method to get all channels
func (*ClnRawLightningAPI) GetInvoices ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
GetInvoices - API call
func (*ClnRawLightningAPI) GetInvoicesRaw ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetInvoicesRaw - API call
func (*ClnRawLightningAPI) GetNodeInfo ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
GetNodeInfo - API call
func (*ClnRawLightningAPI) GetNodeInfoFull ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetNodeInfoFull(ctx context.Context, channels bool, unannounced bool) (*NodeInfoAPIExtended, error)
GetNodeInfoFull - API call
func (*ClnRawLightningAPI) GetPayments ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
GetPayments - API call
func (*ClnRawLightningAPI) GetPaymentsRaw ¶ added in v0.0.44
func (l *ClnRawLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetPaymentsRaw - API call
func (*ClnRawLightningAPI) SubscribeForwards ¶ added in v0.0.44
func (l *ClnRawLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
SubscribeForwards - API call
type ClnRawMessageItf ¶ added in v0.0.42
type ClnRawMessageItf interface {
GetEntries() []json.RawMessage
}
ClnRawMessageItf interface
type ClnRawPayTime ¶ added in v0.0.42
type ClnRawPayTime struct {
Time uint64 `json:"created_at,omitempty"`
}
ClnRawPayTime struct
func (ClnRawPayTime) GetUnixTimeMs ¶ added in v0.0.43
func (r ClnRawPayTime) GetUnixTimeMs() uint64
GetUnixTimeMs to comply with ClnRawTimeItf
type ClnRawPayments ¶ added in v0.0.42
type ClnRawPayments struct {
Entries []json.RawMessage `json:"payments,omitempty"`
}
ClnRawPayments struct
func (ClnRawPayments) GetEntries ¶ added in v0.0.42
func (r ClnRawPayments) GetEntries() []json.RawMessage
GetEntries to comply with ClnRawMessageItf
type ClnRawTimeItf ¶ added in v0.0.42
type ClnRawTimeItf interface {
GetUnixTimeMs() uint64
}
ClnRawTimeItf interface
type ClnResp ¶ added in v0.0.44
type ClnResp struct { }
ClnResp struct is the base type for all responses
type ClnSetChan ¶
type ClnSetChan struct { PeerID string `json:"peer_id"` LongChanID string `json:"channel_id"` FeeBase string `json:"fee_base_msat"` FeePpm string `json:"fee_proportional_milli"` MiHtlc string `json:"minimum_htlc_out_msat"` MaxHtlc string `json:"maximum_htlc_out_msat"` ShortChannelID string `json:"short_channel_id,omitempty"` }
ClnSetChan struct
type ClnSetChanResp ¶
type ClnSetChanResp struct { Settings []ClnSetChan `json:"channels,omitempty"` ClnResp }
ClnSetChanResp struct
type ClnSocketLightningAPI ¶
type ClnSocketLightningAPI struct {
ClnRawLightningAPI
}
ClnSocketLightningAPI struct
type ClnSuccessResp ¶ added in v0.0.44
type ClnSuccessResp struct { ClnResp Result json.RawMessage `json:"result,omitempty"` }
ClnSuccessResp struct
type ClnUnixConnection ¶ added in v0.0.44
type ClnUnixConnection struct { Client *rpc.Client ClnConnection }
ClnUnixConnection represents a UNIX domain socket
func NewUnixConnection ¶ added in v0.0.44
func NewUnixConnection(socketType string, address string) *ClnUnixConnection
NewUnixConnection create a new CLN connection
func (*ClnUnixConnection) Call ¶ added in v0.0.44
func (l *ClnUnixConnection) Call(ctx context.Context, serviceMethod string, args any, reply any) error
Call calls serviceMethod with args and fills reply with response
func (*ClnUnixConnection) Cleanup ¶ added in v0.0.46
func (l *ClnUnixConnection) Cleanup()
Cleanup does the cleanup
func (*ClnUnixConnection) StreamResponse ¶ added in v0.0.44
func (l *ClnUnixConnection) StreamResponse(ctx context.Context, serviceMethod string, args any) (io.Reader, error)
StreamResponse is meant for streaming responses it calls serviceMethod with args and returns an io.Reader
type DescribeGraphAPI ¶
type DescribeGraphAPI struct { Nodes []DescribeGraphNodeAPI Channels []NodeChannelAPI }
DescribeGraphAPI struct
type DescribeGraphNodeAPI ¶
type DescribeGraphNodeAPI struct { PubKey string `json:"pub_key,omitempty"` Alias string `json:"alias,omitempty"` Color string `json:"color,omitempty"` Addresses []NodeAddressAPI `json:"addresses,omitempty"` Features map[string]NodeFeatureAPI `json:"features,omitempty"` LastUpdate entities.JsonTime `json:"last_update,omitempty"` }
DescribeGraphNodeAPI struct
func ConvertNodeInfo ¶
func ConvertNodeInfo(node ClnListNode) *DescribeGraphNodeAPI
ConvertNodeInfo - convert CLN to internal node representation
type ForwardingEvent ¶ added in v0.0.42
type ForwardingEvent struct { Timestamp time.Time ChanIDIn uint64 ChanIDOut uint64 AmountInMsat uint64 AmountOutMsat uint64 FeeMsat uint64 IsSuccess bool FailureString string }
ForwardingEvent struct
type ForwardingEventOverride ¶ added in v0.0.42
type ForwardingEventOverride struct { Timestamp string `json:"timestamp,omitempty"` ChanIDIn string `json:"chan_id_in,omitempty"` ChanIDOut string `json:"chan_id_out,omitempty"` AmtIn string `json:"amt_in,omitempty"` AmtOut string `json:"amt_out,omitempty"` Fee string `json:"fee,omitempty"` FeeMsat string `json:"fee_msat,omitempty"` AmtInMsat string `json:"amt_in_msat,omitempty"` AmtOutMsat string `json:"amt_out_msat,omitempty"` TimestampNs string `json:"timestamp_ns,omitempty"` lnrpc.ForwardingEvent }
ForwardingEventOverride struct
type ForwardingHistoryRequestOverride ¶ added in v0.0.42
type ForwardingHistoryRequestOverride struct { StartTime string `json:"start_time,omitempty"` EndTime string `json:"end_time,omitempty"` lnrpc.ForwardingHistoryRequest }
ForwardingHistoryRequestOverride struct
type ForwardingHistoryResponseOverride ¶ added in v0.0.42
type ForwardingHistoryResponseOverride struct { ForwardingEvents []*ForwardingEventOverride `json:"forwarding_events,omitempty"` lnrpc.ForwardingHistoryResponse }
ForwardingHistoryResponseOverride struct
type GetDataCall ¶
GetDataCall - signature of function for retrieving data
type GetInfoResponseOverride ¶
type GetInfoResponseOverride struct { BestHeaderTimestamp string `json:"best_header_timestamp,omitempty"` lnrpc.GetInfoResponse }
GetInfoResponseOverride struct
type GetNodeInfoOverride ¶
type GetNodeInfoOverride struct { Node *GraphNodeOverride `json:"node,omitempty"` NumChannels int64 `json:"num_channels,omitempty"` TotalCapacity string `json:"total_capacity,omitempty"` Channels []*GraphEdgeOverride `json:"channels"` lnrpc.NodeInfo }
GetNodeInfoOverride struct
type Graph ¶
type Graph struct { GraphNodeOverride []*GraphNodeOverride `json:"nodes,omitempty"` GraphEdgesOverride []*GraphEdgeOverride `json:"edges,omitempty"` }
Graph struct
type GraphEdgeOverride ¶
type GraphEdgeOverride struct { ChannelID string `json:"channel_id,omitempty"` Capacity string `json:"capacity,omitempty"` Node1Policy *RoutingPolicyOverride `json:"node1_policy,omitempty"` Node2Policy *RoutingPolicyOverride `json:"node2_policy,omitempty"` lnrpc.ChannelEdge }
GraphEdgeOverride struct
type GraphNodeOverride ¶
type GraphNodeOverride struct {
lnrpc.LightningNode
}
GraphNodeOverride struct
type HTLCAttempt ¶ added in v0.0.42
type HTLCAttempt struct { ID uint64 Status HTLCStatus Attempt time.Time Resolve time.Time Route Route }
HTLCAttempt struct
type HTLCAttemptOverride ¶ added in v0.0.42
type HTLCAttemptOverride struct { AttemptID string `json:"attempt_id,omitempty"` Status string `json:"status,omitempty"` Route *RouteOverride `json:"route,omitempty"` AttemptTimeNs string `json:"attempt_time_ns,omitempty"` ResolveTimeNs string `json:"resolve_time_ns,omitempty"` Failure json.RawMessage `json:"failure,omitempty"` // ignore Preimage string `protobuf:"bytes,6,opt,name=preimage,proto3" json:"preimage,omitempty"` lnrpc.HTLCAttempt }
HTLCAttemptOverride struct
type HTLCStatus ¶ added in v0.0.42
type HTLCStatus int
HTLCStatus enum
const ( HTLCInFlight HTLCStatus = 0 HTLCSucceeded HTLCFailed )
HTLCStatus values
type HTTPAPI ¶
type HTTPAPI struct { DoFunc GetDoFunc // contains filtered or unexported fields }
HTTPAPI struct
func (*HTTPAPI) GetHTTPRequest ¶
GetHTTPRequest - generic method for doing HTTP requests
func (*HTTPAPI) HTTPForwardEvents ¶ added in v0.0.42
func (h *HTTPAPI) HTTPForwardEvents(ctx context.Context, req *http.Request, input *ForwardingHistoryRequestOverride) (*ForwardingHistoryResponseOverride, error)
HTTPForwardEvents - invokes ForwardEvents method
func (*HTTPAPI) HTTPGetChanInfo ¶
func (h *HTTPAPI) HTTPGetChanInfo(ctx context.Context, req *http.Request, chanID uint64) (*GraphEdgeOverride, error)
HTTPGetChanInfo - invokes GetChanInfo method
func (*HTTPAPI) HTTPGetChannels ¶
HTTPGetChannels - invokes GetChannels method
func (*HTTPAPI) HTTPGetGraph ¶
func (h *HTTPAPI) HTTPGetGraph(ctx context.Context, req *http.Request, unannounced bool) (*Graph, error)
HTTPGetGraph - invokes GetGraph method
func (*HTTPAPI) HTTPGetInfo ¶
func (h *HTTPAPI) HTTPGetInfo(ctx context.Context, req *http.Request) (*GetInfoResponseOverride, error)
HTTPGetInfo - invokes GetInfo method
func (*HTTPAPI) HTTPGetNodeInfo ¶
func (h *HTTPAPI) HTTPGetNodeInfo(ctx context.Context, req *http.Request, pubKey string, channels bool) (*GetNodeInfoOverride, error)
HTTPGetNodeInfo - invokes GetNodeInfo method
func (*HTTPAPI) HTTPListInvoices ¶ added in v0.0.42
func (h *HTTPAPI) HTTPListInvoices(ctx context.Context, req *http.Request, input *ListInvoiceRequestOverride) (*ListInvoiceResponseOverride, error)
HTTPListInvoices - invokes ListInvoices method
func (*HTTPAPI) HTTPListPayments ¶ added in v0.0.42
func (h *HTTPAPI) HTTPListPayments(ctx context.Context, req *http.Request, input *ListPaymentsRequestOverride) (*ListPaymentsResponseOverride, error)
HTTPListPayments - invokes ListPayments method
func (*HTTPAPI) HTTPSubscribeHtlcEvents ¶ added in v0.0.42
func (h *HTTPAPI) HTTPSubscribeHtlcEvents(ctx context.Context, req *http.Request) (<-chan *HtlcEventOverride, error)
HTTPSubscribeHtlcEvents - invokes SubscribeHtlcEvents method
func (*HTTPAPI) SetTransport ¶
SetTransport - sets HTTP transport
type HopHintOverride ¶ added in v0.0.42
HopHintOverride struct
type HopOverride ¶ added in v0.0.42
type HopOverride struct { ChanID string `json:"chan_id,omitempty"` ChanCapacity string `json:"chan_capacity,omitempty"` AmtToForward string `json:"amt_to_forward,omitempty"` Fee string `json:"fee,omitempty"` AmtToForwardMsat string `json:"amt_to_forward_msat,omitempty"` FeeMsat string `json:"fee_msat,omitempty"` MppRecord json.RawMessage `json:"mpp_record,omitempty"` // ignore AmpRecord json.RawMessage `json:"amp_record,omitempty"` // ignore CustomRecords json.RawMessage `json:"custom_records,omitempty"` // ignore Metadata string `json:"metadata,omitempty"` lnrpc.Hop }
HopOverride struct
type HtlcAPI ¶
type HtlcAPI struct { Amount uint64 Incoming bool ForwardingChannel uint64 ForwardingHtlcIndex uint64 }
HtlcAPI struct
type HtlcEventComposite ¶ added in v0.0.42
type HtlcEventComposite struct { Info *HtlcInfoOverride `json:"info,omitempty"` Preimage string `json:"preimage,omitempty"` WireFailure string `json:"wire_failure,omitempty"` FailureDetail string `json:"failure_detail,omitempty"` FailureString string `json:"failure_string,omitempty"` }
HtlcEventComposite struct (our abstraction over that mess with inheritance)
type HtlcEventOverride ¶ added in v0.0.42
type HtlcEventOverride struct { IncomingChannelID string `json:"incoming_channel_id,omitempty"` OutgoingChannelID string `json:"outgoing_channel_id,omitempty"` IncomingHtlcID string `json:"incoming_htlc_id,omitempty"` OutgoingHtlcID string `json:"outgoing_htlc_id,omitempty"` TimestampNs string `json:"timestamp_ns,omitempty"` EventType string `json:"event_type,omitempty"` Event HtlcEventComposite `json:"event,omitempty"` routerrpc.HtlcEvent }
HtlcEventOverride struct
type HtlcInfoOverride ¶ added in v0.0.42
type HtlcInfoOverride struct { IncomingAmtMsat string `json:"incoming_amt_msat,omitempty"` OutgoingAmtMsat string `json:"outgoing_amt_msat,omitempty"` }
HtlcInfoOverride struct
type HtlcOverride ¶
type HtlcOverride struct { Amount string `json:"amount,omitempty"` HashLock string `json:"hash_lock,omitempty"` HtlcIndex string `json:"htlc_index,omitempty"` ForwardingChannel string `json:"forwarding_channel,omitempty"` ForwardingHtlcIndex string `json:"forwarding_htlc_index,omitempty"` lnrpc.HTLC }
HtlcOverride struct
type InfoAPI ¶
type InfoAPI struct { IdentityPubkey string Alias string Chain string Network string Version string IsSyncedToGraph bool IsSyncedToChain bool }
InfoAPI struct
type Invoice ¶ added in v0.0.42
type Invoice struct { Memo string ValueMsat int64 PaidMsat int64 CreationDate time.Time SettleDate time.Time PaymentRequest string DescriptionHash string Expiry int64 FallbackAddr string CltvExpiry uint64 Private bool IsKeySend bool IsAmp bool State InvoiceHTLCState AddIndex uint64 SettleIndex uint64 }
Invoice struct
type InvoiceHTLCState ¶ added in v0.0.42
type InvoiceHTLCState int
InvoiceHTLCState enum
const ( InvoiceAccepted InvoiceHTLCState = 0 InvoiceSettled InvoiceCancelled )
InvoiceHTLCState values
func StringToInvoiceHTLCState ¶ added in v0.0.42
func StringToInvoiceHTLCState(in string) InvoiceHTLCState
StringToInvoiceHTLCState creates InvoiceHTLCState based on a string
type InvoiceOverride ¶ added in v0.0.42
type InvoiceOverride struct { Value string `json:"value,omitempty"` ValueMsat string `json:"value_msat,omitempty"` RPreimage string `json:"r_preimage,omitempty"` RHash string `json:"r_hash,omitempty"` CreationDate string `json:"creation_date,omitempty"` SettleDate string `json:"settle_date,omitempty"` Expiry string `json:"expiry,omitempty"` CltvExpiry string `json:"cltv_expiry,omitempty"` AddIndex string `json:"add_index,omitempty"` SettleIndex string `json:"settle_index,omitempty"` AmtPaid string `json:"amt_paid,omitempty"` AmtPaidSat string `json:"amt_paid_sat,omitempty"` AmtPaidMsat string `json:"amt_paid_msat,omitempty"` DescriptionHash string `json:"description_hash,omitempty"` RouteHints []*RouteHintOverride `json:"route_hints,omitempty"` State string `json:"state,omitempty"` // Ignore this stuff Features json.RawMessage `json:"features,omitempty"` Htlcs json.RawMessage `json:"htlcs,omitempty"` AmpInvoiceState json.RawMessage `json:"amp_invoice_state,omitempty"` lnrpc.Invoice }
InvoiceOverride struct
type InvoicesResponse ¶ added in v0.0.42
type InvoicesResponse struct { Invoices []Invoice ResponsePagination }
InvoicesResponse struct
type LightingAPICalls ¶
type LightingAPICalls interface { Cleanup() GetAPIType() APIType GetInfo(ctx context.Context) (*InfoAPI, error) GetChannels(ctx context.Context) (*ChannelsAPI, error) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error) GetNodeInfoFull(ctx context.Context, channels, unannounced bool) (*NodeInfoAPIExtended, error) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error) }
LightingAPICalls is the interface for lightning API
func NewAPI ¶
func NewAPI(apiType APIType, getData GetDataCall) LightingAPICalls
NewAPI - gets new lightning API
func NewClnCommandoLightningAPI ¶ added in v0.0.44
func NewClnCommandoLightningAPI(getData GetDataCall) LightingAPICalls
NewClnCommandoLightningAPI returns a new lightning API
func NewClnCommandoLightningAPIRaw ¶ added in v0.0.44
func NewClnCommandoLightningAPIRaw(addr, rune string) LightingAPICalls
NewClnCommandoLightningAPIRaw gets a new API (note that addr is in pubkey@address format)
func NewClnSocketLightningAPI ¶
func NewClnSocketLightningAPI(getData GetDataCall) LightingAPICalls
NewClnSocketLightningAPI return a new lightning API
func NewClnSocketLightningAPIRaw ¶
func NewClnSocketLightningAPIRaw(socketType string, address string) LightingAPICalls
NewClnSocketLightningAPIRaw gets a new API - usage "unix", "/home/ubuntu/.lightning/bitcoin/lightning-rpc"
func NewLndGrpcLightningAPI ¶
func NewLndGrpcLightningAPI(getData GetDataCall) LightingAPICalls
NewLndGrpcLightningAPI - creates new lightning API
func NewLndRestLightningAPI ¶
func NewLndRestLightningAPI(getData GetDataCall) LightingAPICalls
NewLndRestLightningAPI constructs new lightning API
type ListInvoiceRequestOverride ¶ added in v0.0.42
type ListInvoiceRequestOverride struct { IndexOffset string `json:"index_offset,omitempty"` NumMaxInvoices string `json:"num_max_invoices,omitempty"` lnrpc.ListInvoiceRequest }
ListInvoiceRequestOverride struct
type ListInvoiceResponseOverride ¶ added in v0.0.42
type ListInvoiceResponseOverride struct { Invoices []*InvoiceOverride `json:"invoices,omitempty"` LastIndexOffset string `json:"last_index_offset,omitempty"` FirstIndexOffset string `json:"first_index_offset,omitempty"` lnrpc.ListInvoiceResponse }
ListInvoiceResponseOverride struct
type ListPaymentsRequestOverride ¶ added in v0.0.42
type ListPaymentsRequestOverride struct { IndexOffset string `json:"index_offset,omitempty"` MaxPayments string `json:"max_payments,omitempty"` lnrpc.ListPaymentsRequest }
ListPaymentsRequestOverride struct
type ListPaymentsResponseOverride ¶ added in v0.0.42
type ListPaymentsResponseOverride struct { Payments []*PaymentOverride `json:"payments,omitempty"` LastIndexOffset string `json:"last_index_offset,omitempty"` FirstIndexOffset string `json:"first_index_offset,omitempty"` TotalNumPayments string `json:"total_num_payments,omitempty"` lnrpc.ListPaymentsResponse }
ListPaymentsResponseOverride struct
type LndGrpcLightningAPI ¶
type LndGrpcLightningAPI struct { Client lnrpc.LightningClient RouterClient routerrpc.RouterClient CleanupFunc func() API }
LndGrpcLightningAPI struct
func (*LndGrpcLightningAPI) DescribeGraph ¶
func (l *LndGrpcLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph API
func (*LndGrpcLightningAPI) GetAPIType ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetAPIType() APIType
GetAPIType API
func (*LndGrpcLightningAPI) GetChanInfo ¶
func (l *LndGrpcLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
GetChanInfo API
func (*LndGrpcLightningAPI) GetChannels ¶
func (l *LndGrpcLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
GetChannels API
func (*LndGrpcLightningAPI) GetForwardsRaw ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetForwardsRaw API
func (*LndGrpcLightningAPI) GetInfo ¶
func (l *LndGrpcLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo API
func (*LndGrpcLightningAPI) GetInvoices ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
GetInvoices API
func (*LndGrpcLightningAPI) GetInvoicesRaw ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetInvoicesRaw API
func (*LndGrpcLightningAPI) GetNodeInfo ¶
func (l *LndGrpcLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
GetNodeInfo API
func (*LndGrpcLightningAPI) GetNodeInfoFull ¶
func (l *LndGrpcLightningAPI) GetNodeInfoFull(ctx context.Context, channels, unnanounced bool) (*NodeInfoAPIExtended, error)
GetNodeInfoFull - GetNodeInfoFull API (GRPC interface)
func (*LndGrpcLightningAPI) GetPayments ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
GetPayments API
func (*LndGrpcLightningAPI) GetPaymentsRaw ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetPaymentsRaw API
func (*LndGrpcLightningAPI) SubscribeFailedForwards ¶ added in v0.0.43
func (l *LndGrpcLightningAPI) SubscribeFailedForwards(ctx context.Context, outchan chan RawMessage) error
SubscribeFailedForwards is used to subscribe to failed forwards
func (*LndGrpcLightningAPI) SubscribeForwards ¶ added in v0.0.42
func (l *LndGrpcLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
SubscribeForwards API
type LndRestLightningAPI ¶
type LndRestLightningAPI struct { Request *http.Request Transport *http.Transport HTTPAPI *HTTPAPI API }
LndRestLightningAPI struct
func (*LndRestLightningAPI) DescribeGraph ¶
func (l *LndRestLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph - DescribeGraph API
func (*LndRestLightningAPI) GetAPIType ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetAPIType() APIType
GetAPIType API
func (*LndRestLightningAPI) GetChanInfo ¶
func (l *LndRestLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
GetChanInfo - GetChanInfo API
func (*LndRestLightningAPI) GetChannels ¶
func (l *LndRestLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
GetChannels - GetChannels API
func (*LndRestLightningAPI) GetForwardsRaw ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetForwardsRaw(ctx context.Context, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetForwardsRaw - API call
func (*LndRestLightningAPI) GetInfo ¶
func (l *LndRestLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo - GetInfo API
func (*LndRestLightningAPI) GetInvoices ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetInvoices(ctx context.Context, pendingOnly bool, pagination Pagination) (*InvoicesResponse, error)
GetInvoices API
func (*LndRestLightningAPI) GetInvoicesRaw ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetInvoicesRaw(ctx context.Context, pendingOnly bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetInvoicesRaw - API call
func (*LndRestLightningAPI) GetNodeInfo ¶
func (l *LndRestLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
GetNodeInfo - GetNodeInfo API
func (*LndRestLightningAPI) GetNodeInfoFull ¶
func (l *LndRestLightningAPI) GetNodeInfoFull(ctx context.Context, channels, unnanounced bool) (*NodeInfoAPIExtended, error)
GetNodeInfoFull - GetNodeInfoFull API (REST interface)
func (*LndRestLightningAPI) GetPayments ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetPayments(ctx context.Context, includeIncomplete bool, pagination Pagination) (*PaymentsResponse, error)
GetPayments API
func (*LndRestLightningAPI) GetPaymentsRaw ¶ added in v0.0.42
func (l *LndRestLightningAPI) GetPaymentsRaw(ctx context.Context, includeIncomplete bool, pagination RawPagination) ([]RawMessage, *ResponseRawPagination, error)
GetPaymentsRaw - API call
func (*LndRestLightningAPI) SubscribeFailedForwards ¶ added in v0.0.43
func (l *LndRestLightningAPI) SubscribeFailedForwards(ctx context.Context, outchan chan RawMessage) error
SubscribeFailedForwards is used to subscribe to failed forwards
func (*LndRestLightningAPI) SubscribeForwards ¶ added in v0.0.42
func (l *LndRestLightningAPI) SubscribeForwards(ctx context.Context, since time.Time, batchSize uint16, maxErrors uint16) (<-chan []ForwardingEvent, <-chan ErrorData)
SubscribeForwards - API call
type NodeAddressAPI ¶
type NodeAddressAPI struct { Network string `json:"network,omitempty"` Addr string `json:"addr,omitempty"` }
NodeAddressAPI struct
func ConvertAddresses ¶
func ConvertAddresses(addr []ClnListNodeAddr) []NodeAddressAPI
ConvertAddresses converts CLN addresses to interanl format
type NodeChannelAPI ¶
type NodeChannelAPI struct { ChannelID uint64 `json:"channel_id,omitempty"` ChanPoint string `json:"chan_point"` Node1Pub string `json:"node1_pub,omitempty"` Node2Pub string `json:"node2_pub,omitempty"` Capacity uint64 `json:"capacity,omitempty"` Node1Policy *RoutingPolicyAPI `json:"node1_policy,omitempty"` Node2Policy *RoutingPolicyAPI `json:"node2_policy,omitempty"` LastUpdate entities.JsonTime `json:"last_update,omitempty"` }
NodeChannelAPI struct
type NodeChannelAPIExtended ¶
type NodeChannelAPIExtended struct { Private bool `json:"private,omitempty"` NodeChannelAPI }
NodeChannelAPIExtended struct
func ConvertChannelInternal ¶
func ConvertChannelInternal(chans []ClnListChan, id uint64, chanpoint string) (*NodeChannelAPIExtended, error)
ConvertChannelInternal - convert CLN channel to internal format
type NodeFeatureAPI ¶
type NodeFeatureAPI struct { Name string `json:"name,omitempty"` IsRequired bool `json:"is_required,omitempty"` IsKnown bool `json:"is_known,omitempty"` }
NodeFeatureAPI struct
type NodeInfoAPI ¶
type NodeInfoAPI struct { Node DescribeGraphNodeAPI `json:"node,omitempty"` Channels []NodeChannelAPI `json:"channels"` NumChannels uint32 `json:"num_channels"` TotalCapacity uint64 `json:"total_capacity"` }
NodeInfoAPI struct
type NodeInfoAPIExtended ¶
type NodeInfoAPIExtended struct { NodeInfoAPI Channels []NodeChannelAPIExtended `json:"channels"` }
NodeInfoAPIExtended struct
type Pagination ¶ added in v0.0.42
type Pagination struct { Offset uint64 // Exclusive thus 1 means start from 2 (0 will start from beginning) BatchSize uint64 // limit is 10k or so Reversed bool From *time.Time To *time.Time }
Pagination struct
type Payment ¶ added in v0.0.42
type Payment struct { PaymentHash string ValueMsat int64 FeeMsat int64 PaymentPreimage string PaymentRequest string PaymentStatus PaymentStatus CreationTime time.Time Index uint64 FailureReason PaymentFailureReason HTLCAttempts []HTLCAttempt }
Payment struct
type PaymentFailureReason ¶ added in v0.0.42
type PaymentFailureReason int
PaymentFailureReason enum
const ( FailureReasonNone PaymentFailureReason = 0 FailureReasonTimeout FailureReasonNoRoute FailureReasonError FailureReasonIncorrectPaymentDetails FailureReasonInsufficientBalance )
PaymentFailureReason values
type PaymentOverride ¶ added in v0.0.42
type PaymentOverride struct { Value string `json:"value,omitempty"` CreationDate string `json:"creation_date,omitempty"` Fee string `json:"fee,omitempty"` ValueSat string `json:"value_sat,omitempty"` ValueMsat string `json:"value_msat,omitempty"` Status string `json:"status,omitempty"` FeeSat string `json:"fee_sat,omitempty"` FeeMsat string `json:"fee_msat,omitempty"` CreationTimeNs string `json:"creation_time_ns,omitempty"` Htlcs []*HTLCAttemptOverride `json:"htlcs,omitempty"` PaymentIndex string `json:"payment_index,omitempty"` FailureReason string `json:"failure_reason,omitempty"` lnrpc.Payment }
PaymentOverride struct
type PaymentStatus ¶ added in v0.0.42
type PaymentStatus int
PaymentStatus enum
const ( PaymentUnknown PaymentStatus = iota PaymentInFlight PaymentSucceeded PaymentFailed )
PaymentStatus values
func StringToPaymentStatus ¶ added in v0.0.42
func StringToPaymentStatus(in string) PaymentStatus
StringToPaymentStatus creates PaymentStatus based on a string
type PaymentsResponse ¶ added in v0.0.42
type PaymentsResponse struct { Payments []Payment ResponsePagination }
PaymentsResponse struct
type RawMessage ¶ added in v0.0.42
type RawMessage struct { Timestamp time.Time `json:"timestamp"` Implementation string `json:"implementation,omitempty"` Message json.RawMessage `json:"message,omitempty"` }
RawMessage struct
type RawPagination ¶ added in v0.0.42
RawPagination struct
type ResponseForwardPagination ¶ added in v0.0.42
type ResponseForwardPagination struct {
LastOffsetIndex uint64
}
ResponseForwardPagination struct
type ResponsePagination ¶ added in v0.0.42
type ResponsePagination struct { ResponseForwardPagination FirstOffsetIndex uint64 }
ResponsePagination struct
type ResponseRawPagination ¶ added in v0.0.42
type ResponseRawPagination struct { UseTimestamp bool FirstTime time.Time LastTime time.Time ResponsePagination }
ResponseRawPagination struct
type RouteHintOverride ¶ added in v0.0.42
type RouteHintOverride struct { HopHints []*HopHintOverride `json:"hop_hints,omitempty"` lnrpc.RouteHint }
RouteHintOverride struct
type RouteOverride ¶ added in v0.0.42
type RouteOverride struct { TotalFees string `json:"total_fees,omitempty"` TotalAmt string `json:"total_amt,omitempty"` Hops []*HopOverride `json:"hops,omitempty"` TotalFeesMsat string `json:"total_fees_msat,omitempty"` TotalAmtMsat string `json:"total_amt_msat,omitempty"` lnrpc.Route }
RouteOverride struct
type RoutingPolicyAPI ¶
type RoutingPolicyAPI struct { TimeLockDelta uint32 `json:"time_lock_delta"` MinHtlc uint64 `json:"min_htlc"` BaseFee uint64 `json:"fee_base_msat"` FeeRate uint64 `json:"fee_rate_milli_msat"` Disabled bool `json:"disabled,omitempty"` LastUpdate entities.JsonTime `json:"last_update,omitempty"` MaxHtlc uint64 `json:"max_htlc_msat"` }
RoutingPolicyAPI struct
type RoutingPolicyOverride ¶
type RoutingPolicyOverride struct { MinHtlc string `json:"min_htlc,omitempty"` FeeBaseMsat string `json:"fee_base_msat,omitempty"` FeeRateMilliMsat string `json:"fee_rate_milli_msat,omitempty"` MaxHtlcMsat string `json:"max_htlc_msat,omitempty"` lnrpc.RoutingPolicy }
RoutingPolicyOverride struct