channels

package
v0.16.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChannelOrUpdateChannelStatus added in v0.10.0

func AddChannelOrUpdateChannelStatus(db *sqlx.DB, channel Channel) (int, error)

func CloseChannel added in v0.7.0

func CloseChannel(eventChannel chan interface{}, db *sqlx.DB, c *gin.Context, ccReq commons.CloseChannelRequest, requestId string) (err error)

func GetClosureStatus added in v0.10.0

func GetClosureStatus(lndClosureType lnrpc.ChannelCloseSummary_ClosureType) commons.ChannelStatus

GetClosureStatus returns Closing when our API is outdated and a new lnrpc.ChannelCloseSummary_ClosureType is added

func GetNodePeerAlias added in v0.12.0

func GetNodePeerAlias(nodeId int, eventNodeId int, db *sqlx.DB) (string, error)

func InitializeManagedChannelCache added in v0.10.0

func InitializeManagedChannelCache(db *sqlx.DB) error

func OpenChannel added in v0.7.0

func OpenChannel(eventChannel chan interface{}, db *sqlx.DB, req commons.OpenChannelRequest, requestId string) (err error)

func RegisterChannelRoutes

func RegisterChannelRoutes(r *gin.RouterGroup, db *sqlx.DB, lightningRequestChannel chan interface{})

func UpdateChannelStatus added in v0.10.0

func UpdateChannelStatus(db *sqlx.DB, channelId int, status commons.ChannelStatus) error

Types

type Channel

type Channel struct {
	// ChannelID A database primary key. NOT a channel_id as specified in BOLT 2
	ChannelID              int                   `json:"channelId" db:"channel_id"`
	Tags                   []tags.Tag            `json:"tags" db:"tags"`
	ShortChannelID         *string               `json:"shortChannelId" db:"short_channel_id"`
	FundingTransactionHash string                `json:"fundingTransactionHash" db:"funding_transaction_hash"`
	FundingOutputIndex     int                   `json:"fundingOutputIndex" db:"funding_output_index"`
	ClosingTransactionHash *string               `json:"closingTransactionHash" db:"closing_transaction_hash"`
	LNDShortChannelID      *uint64               `json:"lndShortChannelId" db:"lnd_short_channel_id"`
	Capacity               int64                 `json:"capacity" db:"capacity"`
	Private                bool                  `json:"private" db:"private"`
	FirstNodeId            int                   `json:"firstNodeId" db:"first_node_id"`
	SecondNodeId           int                   `json:"secondNodeId" db:"second_node_id"`
	InitiatingNodeId       *int                  `json:"initiatingNodeId" db:"initiating_node_id"`
	AcceptingNodeId        *int                  `json:"acceptingNodeId" db:"accepting_node_id"`
	ClosingNodeId          *int                  `json:"closingNodeId" db:"closing_node_id"`
	Status                 commons.ChannelStatus `json:"status" db:"status_id"`
	CreatedOn              time.Time             `json:"createdOn" db:"created_on"`
	UpdateOn               *time.Time            `json:"updatedOn" db:"updated_on"`
	FundingBlockHeight     *int64                `json:"fundingBlockHeight" db:"funding_block_height"`
	FundedOn               *time.Time            `json:"fundedOn" db:"funded_on"`
	ClosingBlockHeight     *int64                `json:"closingBlockHeight" db:"closing_block_height"`
	ClosedOn               *time.Time            `json:"closedOn" db:"closed_on"`
}

func GetAllChannels added in v0.10.0

func GetAllChannels(db *sqlx.DB) (channels []Channel, err error)

func GetChannel added in v0.14.0

func GetChannel(db *sqlx.DB, channelId int) (Channel, error)

func GetChannels added in v0.13.0

func GetChannels(db *sqlx.DB, nodeIds []int, all bool, channelIds []int) ([]*Channel, error)

func GetOpenChannelsForNodeId added in v0.10.0

func GetOpenChannelsForNodeId(db *sqlx.DB, nodeId int) (channels []Channel, err error)

type ChannelForTag added in v0.16.0

type ChannelForTag struct {
	ShortChannelId *string `json:"shortChannelId" db:"short_channel_id"`
	ChannelId      int     `json:"channelId" db:"channel_id"`
	NodeId         int     `json:"nodeId" db:"node_id"`
	Alias          *string `json:"alias" db:"alias"`
	Type           string  `json:"type" db:"type"`
}

func GetChannelsForTag added in v0.16.0

func GetChannelsForTag(db *sqlx.DB) (channels []ChannelForTag, err error)

type ChannelPolicy added in v0.12.0

type ChannelPolicy struct {
	Disabled        bool   `json:"disabled" db:"disabled"`
	TimeLockDelta   uint32 `json:"timeLockDelta" db:"time_lock_delta"`
	MinHtlcMsat     uint64 `json:"minHtlcMsat" db:"min_htlc"`
	MaxHtlcMsat     uint64 `json:"maxHtlcMsat" db:"max_htlc_msat"`
	FeeRateMillMsat uint64 `json:"feeRateMillMsat" db:"fee_rate_mill_msat"`
	ShortChannelId  string `json:"shortChannelId" db:"short_channel_id"`
	FeeBaseMsat     uint64 `json:"feeBaseMsat" db:"fee_base_msat"`
	NodeId          int    `json:"nodeId" db:"node_id"`
	RemoteNodeId    int    `json:"RemoteodeId" db:"remote_node_id"`
}

func GetLocalRoutingPolicy added in v0.12.1

func GetLocalRoutingPolicy(channelId, nodeId int, db *sqlx.DB) (ChannelPolicy, error)

func GetRemoteRoutingPolicy added in v0.12.1

func GetRemoteRoutingPolicy(channelId, nodeId int, db *sqlx.DB) (ChannelPolicy, error)

type ChannelsNodes added in v0.16.0

type ChannelsNodes struct {
	Channels []ChannelForTag `json:"channels"`
	Nodes    []NodeForTag    `json:"nodes"`
}

type NodeForTag added in v0.16.0

type NodeForTag struct {
	NodeId int    `json:"nodeId" db:"node_id"`
	Alias  string `json:"alias" db:"alias"`
	Type   string `json:"type" db:"type"`
}

func GetNodesForTag added in v0.16.0

func GetNodesForTag(db *sqlx.DB) (nodes []NodeForTag, err error)

type PendingHtlcs added in v0.9.0

type PendingHtlcs struct {
	ForwardingCount  int   `json:"forwardingCount"`
	ForwardingAmount int64 `json:"forwardingAmount"`
	LocalCount       int   `json:"localCount"`
	LocalAmount      int64 `json:"localAmount"`
	TotalCount       int   `json:"toalCount"`
	TotalAmount      int64 `json:"totalAmount"`
}

type PsbtDetails added in v0.7.3

type PsbtDetails struct {
	FundingAddress string `json:"funding_address,omitempty"`
	FundingAmount  int64  `json:"funding_amount,omitempty"`
	Psbt           []byte `json:"psbt,omitempty"`
}

Jump to

Keyboard shortcuts

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