channel_history

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FROM_ERROR = "Invalid 'from' date."
	TO_ERROR   = "Invalid 'to' date."
)

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:"inboundCapacity"`
	OutboundCapacity int64     `db:"outbound_capacity" json:"outboundCapacity"`
	CapacityDiff     *int64    `db:"capacity_diff" json:"capacityDiff"`
}

type ChannelBalance added in v0.6.0

type ChannelBalance struct {
	LNDShortChannelId string     `json:"lndShortChannelId"`
	Balances          []*Balance `json:"balances"`
}

type ChannelBalanceHistory added in v0.9.2

type ChannelBalanceHistory struct {
	// Channel balances over time
	ChannelBalances []*ChannelBalance `json:"channelBalances"`
}

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"`
	// Specific time the event happened.
	Datetime  time.Time `json:"datetime"`
	ChannelId int       `json:"channelId"`
	// 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 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:"previousValue"`
}

type ChannelEventHistory added in v0.9.2

type ChannelEventHistory struct {
	Events []*ChannelEvent `json:"events"`
}

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"`

	// The  outbound amount in sats (Satoshis)
	AmountOut *uint64 `json:"amountOut"`
	// The inbound amount in sats (Satoshis)
	AmountIn *uint64 `json:"amountIn"`
	// The total amount in sats (Satoshis) forwarded
	AmountTotal *uint64 `json:"amountTotal"`

	// The outbound revenue in sats. This is what the channel has directly produced.
	RevenueOut *uint64 `json:"revenueOut"`
	// 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:"revenueIn"`
	// The total revenue in sats. This is what the channel has directly and indirectly produced.
	RevenueTotal *uint64 `json:"revenueTotal"`

	// Number of outbound forwards.
	CountOut *uint64 `json:"countOut"`
	// Number of inbound forwards.
	CountIn *uint64 `json:"countIn"`
	// Number of total forwards.
	CountTotal *uint64 `json:"countTotal"`

	// A list of channels included in this response
	Channels []*channels.Channel      `json:"channels"`
	History  []*ChannelHistoryRecords `json:"history"`
}

type ChannelHistoryRecords

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

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

	// The outbound revenue in sats. This is what the channel has directly produced.
	RevenueOut *uint64 `json:"revenueOut"`
	// 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:"revenueIn"`
	// The total revenue in sats. This is what the channel has directly and indirectly produced.
	RevenueTotal *uint64 `json:"revenueTotal"`

	// Number of outbound forwards.
	CountOut *uint64 `json:"countOut"`
	// Number of inbound forwards.
	CountIn *uint64 `json:"countIn"`
	// Number of total forwards.
	CountTotal *uint64 `json:"countTotal"`
}

type ChannelOnChainCost added in v0.9.2

type ChannelOnChainCost struct {
	OnChainCost *uint64 `json:"onChainCost"`
}

type ChannelReBalancing added in v0.9.2

type ChannelReBalancing struct {
	RebalancingCost *uint64 `json:"rebalancingCost"`
	// Aggregated details about successful rebalancing (i.g. amount, cost, counts)
	RebalancingDetails RebalancingDetails `json:"rebalancingDetails"`
}

type RebalancingDetails added in v0.5.0

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

Jump to

Keyboard shortcuts

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