lightning

package
v0.0.0-...-9a3af51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = fmt.Errorf("invalid signature")
View Source
var SignedMsgPrefix = []byte("Lightning Signed Message:")

Functions

func NewOutPoint

func NewOutPoint(fundingTxID []byte, index uint32) (*wire.OutPoint, error)

func NewOutPointFromString

func NewOutPointFromString(outpoint string) (*wire.OutPoint, error)

func VerifyMessage

func VerifyMessage(message []byte, signature string) (*btcec.PublicKey, error)

Types

type Channel

type Channel struct {
	AliasScid     *ShortChannelID
	ConfirmedScid *ShortChannelID
	ChannelPoint  *wire.OutPoint
	PeerId        []byte
}

type Client

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)
	GetPeerId(scid *ShortChannelID) ([]byte, error)
	GetClosedChannels(nodeID string, channelPoints map[string]uint64) (map[string]uint64, error)
	WaitOnline(peerID []byte, deadline time.Time) error
	WaitChannelActive(peerID []byte, deadline time.Time) error
	ListChannels() ([]*Channel, error)
}

type CustomMessage

type CustomMessage struct {
	PeerId string
	Type   uint32
	Data   []byte
}

type CustomMsgClient

type CustomMsgClient interface {
	Recv() (*CustomMessage, error)
	Send(*CustomMessage) error
}

type GetChannelResult

type GetChannelResult struct {
	AliasScid       *ShortChannelID
	ConfirmedScid   *ShortChannelID
	HtlcMinimumMsat uint64
}

type GetInfoResult

type GetInfoResult struct {
	Alias  string
	Pubkey string
}

type OpenChannelRequest

type OpenChannelRequest struct {
	Destination    []byte
	CapacitySat    uint64
	MinConfs       *uint32
	FeeSatPerVByte *float64
	TargetConf     *uint32
}

type ShortChannelID

type ShortChannelID uint64

func NewShortChannelIDFromString

func NewShortChannelIDFromString(channelID string) (*ShortChannelID, error)

func (*ShortChannelID) ToString

func (c *ShortChannelID) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL