lightning

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Lightning Network primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Edge
	ChannelID     ChannelID
	LocalBalance  Satoshi
	LocalFee      FeePPM
	RemoteBalance Satoshi
	RemoteNode    Node
}

Channel between local and remote node.

func (Channel) Liquidity

func (c Channel) Liquidity() float64

Liquidity percent of the channel that is local.

type ChannelID added in v0.2.1

type ChannelID uint64

ChannelID for channel.

type Channels

type Channels []Channel

Channels of node.

type Edge

type Edge struct {
	Capacity Satoshi
	Node1    PubKey
	Node2    PubKey
}

Edge between nodes in the Lightning Network.

type FeePPM

type FeePPM float64

FeePPM is the channel fee in part per million.

func (FeePPM) Rate

func (f FeePPM) Rate() float64

Rate of fee.

type Forward added in v0.2.0

type Forward struct {
	Timestamp  time.Time
	ChannelIn  ChannelID
	ChannelOut ChannelID
}

Forward routing event.

type Graph

type Graph struct {
	Nodes []Node
	Edges []Edge
}

Graph of nodes and edges of the Lightning Network.

type Info

type Info struct {
	PubKey PubKey
}

Info of a node.

type Invoice added in v0.2.1

type Invoice string

Invoice for lightning payment.

type Node

type Node struct {
	PubKey    PubKey
	Alias     string
	Updated   time.Time
	Addresses []string
}

Node in the Lightning Network.

func (Node) Clearnet

func (n Node) Clearnet() bool

Clearnet is true if node has a clearnet address.

type PubKey added in v0.3.6

type PubKey string

PubKey of node.

type Satoshi

type Satoshi int64

Satoshi unit of bitcoin.

func (Satoshi) BTC

func (s Satoshi) BTC() float64

BTC value of Satoshi.

Jump to

Keyboard shortcuts

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