mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-24 01:04:21 +01:00
add LightningClient interface
This commit is contained in:
31
lightning_client.go
Normal file
31
lightning_client.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import "github.com/btcsuite/btcd/wire"
|
||||
|
||||
type GetInfoResult struct {
|
||||
Alias string
|
||||
Pubkey string
|
||||
}
|
||||
|
||||
type GetChannelResult struct {
|
||||
InitialChannelID ShortChannelID
|
||||
ConfirmedChannelID ShortChannelID
|
||||
}
|
||||
|
||||
type OpenChannelRequest struct {
|
||||
Destination []byte
|
||||
CapacitySat uint64
|
||||
MinHtlcMsat uint64
|
||||
TargetConf uint32
|
||||
IsPrivate bool
|
||||
IsZeroConf bool
|
||||
}
|
||||
|
||||
type LightningClient interface {
|
||||
GetInfo() (*GetInfoResult, error)
|
||||
IsConnected(destination []byte) (*bool, error)
|
||||
OpenChannel(req *OpenChannelRequest) (*wire.OutPoint, error)
|
||||
GetChannel(peerID []byte, channelPoint wire.OutPoint) (*GetChannelResult, error)
|
||||
GetNodeChannelCount(nodeID []byte) (int, error)
|
||||
GetClosedChannels(nodeID string, channelPoints map[string]uint64) (map[string]uint64, error)
|
||||
}
|
||||
Reference in New Issue
Block a user