cleanup: move lightning client to seperate package

This commit is contained in:
Jesse de Wit
2023-03-24 14:43:20 +01:00
parent f81037298f
commit 9781ac6bb0
5 changed files with 21 additions and 17 deletions

36
lightning/client.go Normal file
View File

@@ -0,0 +1,36 @@
package lightning
import (
"github.com/breez/lspd/basetypes"
"github.com/btcsuite/btcd/wire"
)
type GetInfoResult struct {
Alias string
Pubkey string
}
type GetChannelResult struct {
InitialChannelID basetypes.ShortChannelID
ConfirmedChannelID basetypes.ShortChannelID
}
type OpenChannelRequest struct {
Destination []byte
CapacitySat uint64
MinHtlcMsat uint64
IsPrivate bool
IsZeroConf bool
MinConfs *uint32
FeeSatPerVByte *float64
TargetConf *uint32
}
type Client 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)
}