channel_history

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterChannelHistoryRoutes

func RegisterChannelHistoryRoutes(r *gin.RouterGroup, db *sqlx.DB)

Types

type Balance added in v0.6.0

type Balance struct {
	Date             time.Time `db:"date" json:"date"`
	InboundCapacity  int64     `db:"inbound_capacity" json:"inbound_capacity"`
	OutboundCapacity int64     `db:"outbound_capacity" json:"outbound_capacity"`
	CapacityDiff     *int64    `db:"capacity_diff" json:"capacity_diff"`
}

type ChannelBalance added in v0.6.0

type ChannelBalance struct {
	LNDShortChannelId string
	Balances          []*Balance
}

type ChannelEvent

type ChannelEvent struct {
	// The date used by the chart library to place roughly in the timeline. Usually bucketed pr day
	Date time.Time `json:"date"`
	// Spesific time the event happened.
	Datetime time.Time `json:"datetime"`
	// The channel point
	LNDChannelPoint *string `json:"lndChannelPoint"`
	// The channel ID
	ShortChannelId *string `json:"shortChannelId"`
	// The type of event. E.g. disable/enable, change in fee rate, base fee, min/max htlc amount
	Type *string `json:"type"`
	// Was this changed by our node (outbound) or their node (inbound)
	Outbound *bool `json:"outbound"`
	// The node that announced the change
	AnnouncingPubKey *string `json:"announcing_pub_key"`
	// The value, in cases where there is a value change,
	//like with fee rate etc. Not used by disable/enable and channel open/close
	Value *uint64 `json:"value"`
	// The previous value
	PreviousValue *uint64 `json:"previous_value"`
}

type ChannelHistory

type ChannelHistory struct {
	// The Label of the requested channels group,
	// this is either an alias in the case where a single channel or a single node is requested.
	// In the case where a group of channels is requested the Label will be based on the common name,
	// such as a tag.
	Label string `json:"label"`

	OnChainCost     *uint64 `json:"on_chain_cost"`
	RebalancingCost *uint64 `json:"rebalancing_cost"`

	// The  outbound amount in sats (Satoshis)
	AmountOut *uint64 `json:"amount_out"`
	// The inbound amount in sats (Satoshis)
	AmountIn *uint64 `json:"amount_in"`
	// The total amount in sats (Satoshis) forwarded
	AmountTotal *uint64 `json:"amount_total"`

	// The outbound revenue in sats. This is what the channel has directly produced.
	RevenueOut *uint64 `json:"revenue_out"`
	// The inbound revenue in sats. This is what the channel has indirectly produced.
	// This revenue are not really earned by this channel/peer/group, but represents
	// the channel/peer/group contribution to revenue earned by other channels.
	RevenueIn *uint64 `json:"revenue_in"`
	// The total revenue in sats. This is what the channel has directly and indirectly produced.
	RevenueTotal *uint64 `json:"revenue_total"`

	// Number of outbound forwards.
	CountOut *uint64 `json:"count_out"`
	// Number of inbound forwards.
	CountIn *uint64 `json:"count_in"`
	// Number of total forwards.
	CountTotal *uint64 `json:"count_total"`

	// Aggregated details about successful rebalancing (i.g. amount, cost, counts)
	RebalancingDetails RebalancingDetails `json:"rebalancing"`

	// Channel balances over time
	ChannelBalances []*ChannelBalance `json:"channel_balance"`

	// A list of channels included in this response
	Channels []*channel               `json:"channels"`
	History  []*ChannelHistoryRecords `json:"history"`
	Events   []*ChannelEvent          `json:"events"`
}

type ChannelHistoryRecords

type ChannelHistoryRecords struct {
	Alias string `json:"alias"`

	Date time.Time `json:"date"`
	// The  outbound amount in sats (Satoshis)
	AmountOut *uint64 `json:"amount_out"`
	// The inbound amount in sats (Satoshis)
	AmountIn *uint64 `json:"amount_in"`
	// The total amount in sats (Satoshis) forwarded
	AmountTotal *uint64 `json:"amount_total"`

	// The outbound revenue in sats. This is what the channel has directly produced.
	RevenueOut *uint64 `json:"revenue_out"`
	// The inbound revenue in sats. This is what the channel has indirectly produced.
	// This revenue are not really earned by this channel/peer/group, but represents
	// the channel/peer/group contribution to revenue earned by other channels.
	RevenueIn *uint64 `json:"revenue_in"`
	// The total revenue in sats. This is what the channel has directly and indirectly produced.
	RevenueTotal *uint64 `json:"revenue_total"`

	// Number of outbound forwards.
	CountOut *uint64 `json:"count_out"`
	// Number of inbound forwards.
	CountIn *uint64 `json:"count_in"`
	// Number of total forwards.
	CountTotal *uint64 `json:"count_total"`
}

type RebalancingDetails added in v0.5.0

type RebalancingDetails struct {
	AmountMsat    uint64 `db:"amount_msat" json:"amount_msat"`
	TotalCostMsat uint64 `db:"total_cost_msat" json:"total_cost_msat"`
	SplitCostMsat uint64 `db:"split_cost_msat" json:"split_cost_msat"`
	Count         uint64 `db:"count" json:"count"`
}

Jump to

Keyboard shortcuts

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