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, 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 APIType
- type CertificateVerification
- type ChannelAPI
- type ChannelConstraintsOverride
- type ChannelOverride
- type Channels
- type ChannelsAPI
- type ClnFeatures
- type ClnFundsChan
- type ClnFundsChanResp
- type ClnInfo
- type ClnListChan
- type ClnListChanResp
- type ClnListNode
- type ClnListNodeAddr
- type ClnListNodeResp
- type ClnSetChan
- type ClnSetChanResp
- type ClnSocketLightningAPI
- func (l *ClnSocketLightningAPI) CallWithTimeout(serviceMethod string, args any, reply any) error
- func (l *ClnSocketLightningAPI) Cleanup()
- func (l *ClnSocketLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *ClnSocketLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *ClnSocketLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *ClnSocketLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
- func (l *ClnSocketLightningAPI) GetInternalChannels(pubKey string) (map[string][]ClnListChan, error)
- func (l *ClnSocketLightningAPI) GetInternalChannelsAll() (map[string][]ClnListChan, error)
- func (l *ClnSocketLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
- func (l *ClnSocketLightningAPI) GetNodeInfoFull(ctx context.Context, channels bool, unannounced bool) (*NodeInfoAPIExtended, error)
- type DescribeGraphAPI
- type DescribeGraphNodeAPI
- type GetDataCall
- type GetDoFunc
- type GetInfoResponseOverride
- type GetNodeInfoOverride
- type Graph
- type GraphEdgeOverride
- type GraphNodeOverride
- 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) HTTPGetChanInfo(ctx context.Context, req *http.Request, trans *http.Transport, chanID uint64) (*GraphEdgeOverride, error)
- func (h *HTTPAPI) HTTPGetChannels(ctx context.Context, req *http.Request, trans *http.Transport) (*Channels, error)
- func (h *HTTPAPI) HTTPGetGraph(ctx context.Context, req *http.Request, trans *http.Transport, ...) (*Graph, error)
- func (h *HTTPAPI) HTTPGetInfo(ctx context.Context, req *http.Request, trans *http.Transport) (*GetInfoResponseOverride, error)
- func (h *HTTPAPI) HTTPGetNodeInfo(ctx context.Context, req *http.Request, trans *http.Transport, pubKey string, ...) (*GetNodeInfoOverride, error)
- func (h *HTTPAPI) SetTransport(transport *http.Transport)
- type HtlcAPI
- type HtlcOverride
- type InfoAPI
- type LightingAPICalls
- func NewAPI(apiType APIType, getData GetDataCall) LightingAPICalls
- func NewClnSocketLightningAPI(getData GetDataCall) LightingAPICalls
- func NewClnSocketLightningAPIRaw(socketType string, address string) LightingAPICalls
- func NewLndGrpcLightningAPI(getData GetDataCall) LightingAPICalls
- func NewLndRestLightningAPI(getData GetDataCall) LightingAPICalls
- type LightningAPI
- type LndGrpcLightningAPI
- func (l *LndGrpcLightningAPI) Cleanup()
- func (l *LndGrpcLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *LndGrpcLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *LndGrpcLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *LndGrpcLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, 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)
- type LndRestLightningAPI
- func (l *LndRestLightningAPI) Cleanup()
- func (l *LndRestLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
- func (l *LndRestLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
- func (l *LndRestLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
- func (l *LndRestLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, 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)
- type NodeAddressAPI
- type NodeChannelAPI
- type NodeChannelAPIExtended
- type NodeFeatureAPI
- type NodeInfoAPI
- type NodeInfoAPIExtended
- type RoutingPolicyAPI
- type RoutingPolicyOverride
Constants ¶
const ( LISTCHANNELS = "listchannels" LISTNODES = "listnodes" LISTFUNDS = "listfunds" GETINFO = "getinfo" )
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, 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 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 ClnFeatures ¶
type ClnFeatures struct { Init string `json:"init"` Node string `json:"node"` Channel string `json:"channe"` Invoice string `json:"invoice"` }
ClnFeatures 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_tx_id"` FundingOutput int `json:"funding_output"` }
ClnFundsChan struct
type ClnFundsChanResp ¶
type ClnFundsChanResp struct {
Channels []ClnFundsChan `json:"channels,omitempty"`
}
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"`
}
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"`
}
ClnListNodeResp struct
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"`
}
ClnSetChanResp struct
type ClnSocketLightningAPI ¶
type ClnSocketLightningAPI struct { LightningAPI Client *rpc.Client Timeout time.Duration }
ClnSocketLightningAPI struct
func (*ClnSocketLightningAPI) CallWithTimeout ¶
func (l *ClnSocketLightningAPI) CallWithTimeout(serviceMethod string, args any, reply any) error
CallWithTimeout - helper to call rpc method with a timeout
func (*ClnSocketLightningAPI) Cleanup ¶
func (l *ClnSocketLightningAPI) Cleanup()
Cleanup - clean up API
func (*ClnSocketLightningAPI) DescribeGraph ¶
func (l *ClnSocketLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph - DescribeGraph API call
func (*ClnSocketLightningAPI) GetChanInfo ¶
func (l *ClnSocketLightningAPI) GetChanInfo(ctx context.Context, chanID uint64) (*NodeChannelAPI, error)
GetChanInfo - GetChanInfo API call
func (*ClnSocketLightningAPI) GetChannels ¶
func (l *ClnSocketLightningAPI) GetChannels(ctx context.Context) (*ChannelsAPI, error)
GetChannels - GetChannels API call
func (*ClnSocketLightningAPI) GetInfo ¶
func (l *ClnSocketLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo - GetInfo API call
func (*ClnSocketLightningAPI) GetInternalChannels ¶
func (l *ClnSocketLightningAPI) GetInternalChannels(pubKey string) (map[string][]ClnListChan, error)
GetInternalChannels - internal method to get channels
func (*ClnSocketLightningAPI) GetInternalChannelsAll ¶
func (l *ClnSocketLightningAPI) GetInternalChannelsAll() (map[string][]ClnListChan, error)
GetInternalChannelsAll - internal method to get all channels
func (*ClnSocketLightningAPI) GetNodeInfo ¶
func (l *ClnSocketLightningAPI) GetNodeInfo(ctx context.Context, pubKey string, channels bool) (*NodeInfoAPI, error)
GetNodeInfo - GetNodeInfo API call
func (*ClnSocketLightningAPI) GetNodeInfoFull ¶
func (l *ClnSocketLightningAPI) GetNodeInfoFull(ctx context.Context, channels bool, unannounced bool) (*NodeInfoAPIExtended, error)
GetNodeInfoFull - GetNodeInfoFull API call
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 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 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) HTTPGetChanInfo ¶
func (h *HTTPAPI) HTTPGetChanInfo(ctx context.Context, req *http.Request, trans *http.Transport, chanID uint64) (*GraphEdgeOverride, error)
HTTPGetChanInfo - invokes GetChanInfo method
func (*HTTPAPI) HTTPGetChannels ¶
func (h *HTTPAPI) HTTPGetChannels(ctx context.Context, req *http.Request, trans *http.Transport) (*Channels, error)
HTTPGetChannels - invokes GetChannels method
func (*HTTPAPI) HTTPGetGraph ¶
func (h *HTTPAPI) HTTPGetGraph(ctx context.Context, req *http.Request, trans *http.Transport, unannounced bool) (*Graph, error)
HTTPGetGraph - invokes GetGraph method
func (*HTTPAPI) HTTPGetInfo ¶
func (h *HTTPAPI) HTTPGetInfo(ctx context.Context, req *http.Request, trans *http.Transport) (*GetInfoResponseOverride, error)
HTTPGetInfo - invokes GetInfo method
func (*HTTPAPI) HTTPGetNodeInfo ¶
func (h *HTTPAPI) HTTPGetNodeInfo(ctx context.Context, req *http.Request, trans *http.Transport, pubKey string, channels bool) (*GetNodeInfoOverride, error)
HTTPGetNodeInfo - invokes GetNodeInfo method
func (*HTTPAPI) SetTransport ¶
SetTransport - sets HTTP transport
type HtlcAPI ¶
type HtlcAPI struct { Amount uint64 Incoming bool ForwardingChannel uint64 ForwardingHtlcIndex uint64 }
HtlcAPI 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 LightingAPICalls ¶
type LightingAPICalls interface { Cleanup() 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) }
LightingAPICalls is the interface for lightning API
func NewAPI ¶
func NewAPI(apiType APIType, getData GetDataCall) LightingAPICalls
NewAPI - gets new lightning API
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 LightningAPI ¶
type LightningAPI struct {
GetNodeInfoFullThreshUseDescribeGraph int // If node has more than that number of channels use DescribeGraph else do GetChanInfo for each one
}
LightningAPI - generic API settings
type LndGrpcLightningAPI ¶
type LndGrpcLightningAPI struct { Client lnrpc.LightningClient CleanupFunc func() LightningAPI }
LndGrpcLightningAPI struct
func (*LndGrpcLightningAPI) DescribeGraph ¶
func (l *LndGrpcLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph 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) GetInfo ¶
func (l *LndGrpcLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo 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)
type LndRestLightningAPI ¶
type LndRestLightningAPI struct { Request *http.Request Transport *http.Transport HTTPAPI *HTTPAPI LightningAPI }
LndRestLightningAPI struct
func (*LndRestLightningAPI) DescribeGraph ¶
func (l *LndRestLightningAPI) DescribeGraph(ctx context.Context, unannounced bool) (*DescribeGraphAPI, error)
DescribeGraph - DescribeGraph 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) GetInfo ¶
func (l *LndRestLightningAPI) GetInfo(ctx context.Context) (*InfoAPI, error)
GetInfo - GetInfo API
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)
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) (*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 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