channels

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 24 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 SetRoutingPolicyWithTimeout added in v0.18.1

func SetRoutingPolicyWithTimeout(request commons.RoutingPolicyUpdateRequest,
	lightningRequestChannel chan interface{}) commons.RoutingPolicyUpdateResponse

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     *uint32               `json:"fundingBlockHeight" db:"funding_block_height"`
	FundedOn               *time.Time            `json:"fundedOn" db:"funded_on"`
	ClosingBlockHeight     *uint32               `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 ChannelBody added in v0.18.1

type ChannelBody struct {
	NodeId                       int                  `json:"nodeId"`
	PeerNodeId                   int                  `json:"peerNodeId"`
	ChannelId                    int                  `json:"channelId"`
	ChannelPoint                 string               `json:"channelPoint"`
	NodeName                     string               `json:"nodeName"`
	Tags                         []tags.Tag           `json:"tags"`
	Active                       bool                 `json:"active"`
	RemoteActive                 bool                 `json:"remoteActive"`
	CurrentBlockHeight           uint32               `json:"currentBlockHeight"`
	Gauge                        float64              `json:"gauge"`
	RemotePubkey                 string               `json:"remotePubkey"`
	FundingTransactionHash       string               `json:"fundingTransactionHash"`
	FundingOutputIndex           int                  `json:"fundingOutputIndex"`
	FundingBlockHeight           *uint32              `json:"fundingBlockHeight"`
	FundingBlockHeightDelta      *uint32              `json:"fundingBlockHeightDelta"`
	FundedOn                     *time.Time           `json:"fundedOn"`
	FundedOnSecondsDelta         *uint64              `json:"fundedOnSecondsDelta"`
	ClosingBlockHeight           *uint32              `json:"closingBlockHeight"`
	ClosingBlockHeightDelta      *uint32              `json:"closingBlockHeightDelta"`
	ClosedOn                     *time.Time           `json:"closedOn"`
	ClosedOnSecondsDelta         *uint64              `json:"closedOnSecondsDelta"`
	LNDShortChannelId            string               `json:"lndShortChannelId"`
	ShortChannelId               string               `json:"shortChannelId"`
	Capacity                     int64                `json:"capacity"`
	LocalBalance                 int64                `json:"localBalance"`
	RemoteBalance                int64                `json:"remoteBalance"`
	UnsettledBalance             int64                `json:"unsettledBalance"`
	CommitFee                    int64                `json:"commitFee"`
	CommitWeight                 int64                `json:"commitWeight"`
	FeePerKw                     int64                `json:"feePerKw"`
	FeeBase                      int64                `json:"feeBase"`
	MinHtlc                      uint64               `json:"minHtlc"`
	MaxHtlc                      uint64               `json:"maxHtlc"`
	TimeLockDelta                uint32               `json:"timeLockDelta"`
	FeeRateMilliMsat             int64                `json:"feeRateMilliMsat"`
	RemoteFeeBase                int64                `json:"remoteFeeBase"`
	RemoteMinHtlc                uint64               `json:"remoteMinHtlc"`
	RemoteMaxHtlc                uint64               `json:"remoteMaxHtlc"`
	RemoteTimeLockDelta          uint32               `json:"remoteTimeLockDelta"`
	RemoteFeeRateMilliMsat       int64                `json:"remoteFeeRateMilliMsat"`
	PendingForwardingHTLCsCount  int                  `json:"pendingForwardingHTLCsCount"`
	PendingForwardingHTLCsAmount int64                `json:"pendingForwardingHTLCsAmount"`
	PendingLocalHTLCsCount       int                  `json:"pendingLocalHTLCsCount"`
	PendingLocalHTLCsAmount      int64                `json:"pendingLocalHTLCsAmount"`
	PendingTotalHTLCsCount       int                  `json:"pendingTotalHTLCsCount"`
	PendingTotalHTLCsAmount      int64                `json:"pendingTotalHTLCsAmount"`
	TotalSatoshisSent            int64                `json:"totalSatoshisSent"`
	NumUpdates                   uint64               `json:"numUpdates"`
	Initiator                    bool                 `json:"initiator"`
	ChanStatusFlags              string               `json:"chanStatusFlags"`
	LocalChanReserveSat          int64                `json:"localChanReserveSat"`
	RemoteChanReserveSat         int64                `json:"remoteChanReserveSat"`
	CommitmentType               lnrpc.CommitmentType `json:"commitmentType"`
	Lifetime                     int64                `json:"lifetime"`
	TotalSatoshisReceived        int64                `json:"totalSatoshisReceived"`
	MempoolSpace                 string               `json:"mempoolSpace"`
	AmbossSpace                  string               `json:"ambossSpace"`
	OneMl                        string               `json:"oneMl"`
	PeerAlias                    string               `json:"peerAlias"`
}

func GetChannelsByIds added in v0.18.1

func GetChannelsByIds(db *sqlx.DB, nodeId int, channelIds []int) ([]ChannelBody, error)

func GetChannelsByNetwork added in v0.18.1

func GetChannelsByNetwork(db *sqlx.DB, network commons.Network) ([]ChannelBody, 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 int64  `json:"feeRateMillMsat" db:"fee_rate_mill_msat"`
	ShortChannelId  string `json:"shortChannelId" db:"short_channel_id"`
	FeeBaseMsat     int64  `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