commons

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LndService = ServiceType(iota)
	VectorService
	AmbossService
	TorqService
	AutomationService
	LightningCommunicationService
	RebalanceService
	MaintenanceService
)

When adding here also add to GetServiceTypes

View Source
const (
	Boot = ServiceCommand(iota)
	// Kill requires Out return channel
	// status: Active => Service kill initiated
	// status: Pending => Service is booting and cannot be killed
	// status: Inactive => Service was not running and could not be killed
	Kill
)
View Source
const (
	Inactive = Status(iota)
	Active
	Pending
	Deleted
	Initializing
	Archived
)
View Source
const (
	LND = Implementation(iota)
	CLN
)
View Source
const (
	Bitcoin = Chain(iota)
	Litecoin
)
View Source
const (
	MainNet = Network(iota)
	TestNet
	RegTest
	SigNet
	SimNet
)
View Source
const (
	Opening = ChannelStatus(iota)
	Open
	Closing
	CooperativeClosed      = 100
	LocalForceClosed       = 101
	RemoteForceClosed      = 102
	BreachClosed           = 103
	FundingCancelledClosed = 104
	AbandonedClosed        = 105
)
View Source
const (
	TransactionStream = SubscriptionStream(iota)
	HtlcEventStream
	ChannelEventStream
	GraphEventStream
	ForwardStream
	InvoiceStream
	PaymentStream
	InFlightPaymentStream
	PeerEventStream
	ChannelBalanceCacheStream
)
View Source
const (
	ImportChannelAndRoutingPolicies = ImportType(iota)
	ImportNodeInformation
)
View Source
const (
	MEMPOOL string = "https://mempool.space/lightning/channel/"
	AMBOSS  string = "https://amboss.space/edge/"
	ONEML   string = "https://1ml.com/channel/"
)
View Source
const (
	WorkflowNodeTimeTrigger = WorkflowNodeType(iota)
	WorkflowNodeChannelBalanceEventTrigger
	WorkflowNodeChannelFilter
	WorkflowNodeChannelPolicyConfigurator
	WorkflowNodeRebalanceParameters
	WorkflowNodeStageTrigger
	WorkflowNodeRebalanceRun
	WorkflowNodeChannelPolicyRun
	WorkflowNodeSetVariable
	WorkflowNodeFilterOnVariable
	WorkflowTrigger
)
View Source
const (
	WorkflowTriggerTimingService = WorkflowTriggerType(iota)
	WorkflowTriggerEventService
)
View Source
const (
	WorkflowParameterAny                   = WorkflowParameter("any")
	WorkflowParameterTriggered             = WorkflowParameter("triggered")
	WorkflowParameterChannelIds            = WorkflowParameter("channelIds")
	WorkflowParameterRoutingPolicySettings = WorkflowParameter("routingPolicySettings")
	WorkflowParameterRebalanceSettings     = WorkflowParameter("rebalanceSettings")
	WorkflowParameterStatus                = WorkflowParameter("status")
)
View Source
const (
	WorkflowParameterTimeInSeconds = WorkflowParameterType(iota)
	WorkflowParameterBalanceShifted
	WorkflowParameterVariableName
	WorkflowParameterVariableValueString
	WorkflowParameterVariableValueNumber
)
View Source
const (
	RebalanceRequestWorkflowNode = RebalanceRequestOrigin(iota)
	RebalanceRequestManual
)
View Source
const AMBOSS_SLEEP_SECONDS = 25
View Source
const AVOID_CHANNEL_AND_POLICY_IMPORT_RERUN_TIME_SECONDS = 70

70 because a reconnection is attempted every 60 seconds

View Source
const BOOTSTRAPPING_TIME_MINUTES = 8 * 60
View Source
const CHANNELBALANCE_BOOTSTRAP_TICKER_SECONDS = 10
View Source
const CHANNELBALANCE_TICKER_SECONDS = 150
View Source
const GENERIC_BOOTSTRAPPING_TIME_SECONDS = 60
View Source
const MAINTENANCE_QUEUE_TICKER_SECONDS = 60 * 60
View Source
const MAINTENANCE_VECTOR_DELAY_MILLISECONDS = 500
View Source
const NodeConnectionDetailCustomSettingsMax = int(ImportFailedPayments)*2 - 1
View Source
const PingSystemMax = int(Vector)*2 - 1
View Source
const REBALANCE_MAXIMUM_CONCURRENCY = 10
View Source
const REBALANCE_MINIMUM_DELTA_SECONDS = 10 * 60
View Source
const REBALANCE_QUEUE_TICKER_SECONDS = 10
View Source
const REBALANCE_REBALANCE_DELAY_MILLISECONDS = 500
View Source
const REBALANCE_RESULTS_TIMEOUT_SECONDS = 5 * 60
View Source
const REBALANCE_ROUTES_TIMEOUT_SECONDS = 1 * 60
View Source
const REBALANCE_ROUTE_FAILED_HOP_ALLOWED_DELTA_PER_MILLE = 10
View Source
const REBALANCE_ROUTE_TIMEOUT_SECONDS = 10 * 60
View Source
const REBALANCE_RUNNER_TIMEOUT_SECONDS = 1 * 60 * 60
View Source
const REBALANCE_SUCCESS_TIMEOUT_SECONDS = 2 * 60
View Source
const REBALANCE_TIMEOUT_SECONDS = 2 * 60 * 60
View Source
const ROUTING_POLICY_UPDATE_LIMITER_SECONDS = 5 * 60
View Source
const SERVICES_ERROR_SLEEP_SECONDS = 60
View Source
const STREAM_BOOTED_CHECK_SECONDS = 5
View Source
const STREAM_ERROR_SLEEP_SECONDS = 60
View Source
const STREAM_FORWARDS_TICKER_SECONDS = 10
View Source
const STREAM_INFLIGHT_PAYMENTS_TICKER_SECONDS = 60
View Source
const STREAM_LND_INVOICES_DELTA_TIME_MILLISECONDS = 1000
View Source
const STREAM_LND_INVOICES_INTERVAL_SLEEP = 10
View Source
const STREAM_LND_INVOICES_SLEEP_MILLISECONDS = 1000
View Source
const STREAM_LND_MAX_FORWARDS = 50000
View Source
const STREAM_LND_MAX_INVOICES = 1000
View Source
const STREAM_PAYMENTS_TICKER_SECONDS = 10
View Source
const TOLERATED_SUBSCRIPTION_DOWNTIME_SECONDS = 15
View Source
const TorqDummyNodeId = -1337
View Source
const VECTOR_PING_URL = VECTOR_URL + "api/publicNodeEvents/ping"
View Source
const VECTOR_SHORTCHANNELID_URL = VECTOR_URL + "api/bitcoin/shortChannelId"
View Source
const VECTOR_SLEEP_SECONDS = 20
View Source
const VECTOR_TRANSACTIONDETAILS_URL = VECTOR_URL + "api/bitcoin/transactionDetails"
View Source
const VECTOR_URL = "https://vector.ln.capital/"
View Source
const WORKFLOW_LOG_COUNT = 100
View Source
const WORKFLOW_TICKER_SECONDS = 10

Variables

View Source
var ManagedChannelChannel = make(chan ManagedChannel) //nolint:gochecknoglobals
View Source
var ManagedChannelGroupChannel = make(chan ManagedChannelGroup) //nolint:gochecknoglobals
View Source
var ManagedChannelStateChannel = make(chan ManagedChannelState) //nolint:gochecknoglobals
View Source
var ManagedNodeChannel = make(chan ManagedNode) //nolint:gochecknoglobals
View Source
var ManagedRebalanceChannel = make(chan ManagedRebalance) //nolint:gochecknoglobals
View Source
var ManagedSettingsChannel = make(chan ManagedSettings) //nolint:gochecknoglobals
View Source
var ManagedTriggerChannel = make(chan ManagedTrigger) //nolint:gochecknoglobals
View Source
var RunningServices map[ServiceType]*Services //nolint:gochecknoglobals

Functions

func AddRebalanceAndChannels added in v0.16.0

func AddRebalanceAndChannels(db *sqlx.DB, rebalancer *Rebalancer) error

func AddRebalanceLog added in v0.16.0

func AddRebalanceLog(db *sqlx.DB, rebalanceResult RebalanceResult) error

func ConvertLNDShortChannelID added in v0.14.0

func ConvertLNDShortChannelID(LNDShortChannelID uint64) string

func ConvertShortChannelIDToLND added in v0.14.0

func ConvertShortChannelIDToLND(ShortChannelID string) (uint64, error)

func CopyParameters added in v0.16.0

func CopyParameters(parameters map[string]string) map[string]string

func CreateChannelPoint added in v0.14.0

func CreateChannelPoint(fundingTransactionHash string, fundingOutputIndex int) string

func GetActiveChannelIdByFundingTransaction added in v0.13.0

func GetActiveChannelIdByFundingTransaction(fundingTransactionHash string, fundingOutputIndex int) int

func GetActiveChannelIdByShortChannelId added in v0.13.0

func GetActiveChannelIdByShortChannelId(shortChannelId string) int

func GetActiveNodeIdByPublicKey added in v0.13.0

func GetActiveNodeIdByPublicKey(publicKey string, chain Chain, network Network) int

func GetAllActiveTorqNodeIds added in v0.13.0

func GetAllActiveTorqNodeIds(chain *Chain, network *Network) []int

func GetAllChannelPublicKeys

func GetAllChannelPublicKeys(chain Chain, network Network) []string

func GetAllTorqNodeIds

func GetAllTorqNodeIds(chain Chain, network Network) []int

func GetAllTorqPublicKeys

func GetAllTorqPublicKeys(chain Chain, network Network) []string

func GetChannelIdByChannelPoint added in v0.14.0

func GetChannelIdByChannelPoint(channelPoint string) int

func GetChannelIdByFundingTransaction added in v0.13.0

func GetChannelIdByFundingTransaction(fundingTransactionHash string, fundingOutputIndex int) int

func GetChannelIdByLndShortChannelId added in v0.14.0

func GetChannelIdByLndShortChannelId(lndShortChannelId uint64) int

func GetChannelIdByShortChannelId added in v0.13.0

func GetChannelIdByShortChannelId(shortChannelId string) int

func GetChannelIdsByNodeId added in v0.14.0

func GetChannelIdsByNodeId(peerNodeId int) []int

func GetChannelNodeIds

func GetChannelNodeIds(chain Chain, network Network) []int

func GetChannelPublicKeys

func GetChannelPublicKeys(chain Chain, network Network) []string

func GetNodeIdByPublicKey added in v0.13.0

func GetNodeIdByPublicKey(publicKey string, chain Chain, network Network) int

func GetShortChannelIdFromVector added in v0.16.4

func GetShortChannelIdFromVector(fundingTransactionHash string, fundingOutputIndex int, nodeSettings ManagedNodeSettings,
	lightningRequestChannel chan interface{}) string

func GetWorkflowNodes added in v0.16.0

func GetWorkflowNodes() map[WorkflowNodeType]WorkflowNodeTypeParameters

func InactivateChannelNode

func InactivateChannelNode(publicKey string, chain Chain, network Network)

func MaintenanceServiceStart added in v0.16.4

func MaintenanceServiceStart(ctx context.Context, db *sqlx.DB, nodeId int, lightningCommunicationChannel chan interface{})

func ManagedChannelCache

func ManagedChannelCache(ch chan ManagedChannel, ctx context.Context)

func ManagedChannelGroupCache added in v0.12.0

func ManagedChannelGroupCache(ch chan ManagedChannelGroup, ctx context.Context)

func ManagedChannelStateCache added in v0.14.0

func ManagedChannelStateCache(ch chan ManagedChannelState, ctx context.Context, channelEvent chan interface{})

ManagedChannelStateCache parameter Context is for test cases...

func ManagedNodeCache

func ManagedNodeCache(ch chan ManagedNode, ctx context.Context)

ManagedNodeCache parameter Context is for test cases...

func ManagedRebalanceCache added in v0.16.0

func ManagedRebalanceCache(ch chan ManagedRebalance, ctx context.Context)

func ManagedSettingsCache

func ManagedSettingsCache(ch chan ManagedSettings, ctx context.Context)

func ManagedTriggerCache added in v0.16.0

func ManagedTriggerCache(ch chan ManagedTrigger, ctx context.Context)

func MutexLocked added in v0.11.0

func MutexLocked(m *sync.Mutex) bool

func ParseChannelPoint added in v0.14.0

func ParseChannelPoint(channelPoint string) (string, int)

func RWMutexReadLocked added in v0.13.0

func RWMutexReadLocked(rw *sync.RWMutex) bool

func RWMutexWriteLocked added in v0.13.0

func RWMutexWriteLocked(rw *sync.RWMutex) bool

func RebalanceServiceStart added in v0.16.0

func RebalanceServiceStart(ctx context.Context, conn *grpc.ClientConn, db *sqlx.DB, nodeId int,
	rebalanceRequestChannel chan RebalanceRequest)

func SendServiceEvent added in v0.16.1

func SendServiceEvent(nodeId int, eventChannel chan interface{}, previousStatus Status, status Status,
	serviceType ServiceType, subscriptionStream *SubscriptionStream)

func SendToManagedBoolChannel added in v0.16.0

func SendToManagedBoolChannel(ch chan bool, result bool)

func SendToManagedChannelBalanceStateSettingsChannel added in v0.14.0

func SendToManagedChannelBalanceStateSettingsChannel(ch chan *ManagedChannelBalanceStateSettings, managedChannelBalanceStateSettings *ManagedChannelBalanceStateSettings)

func SendToManagedChannelBalanceStatesSettingsChannel added in v0.14.0

func SendToManagedChannelBalanceStatesSettingsChannel(ch chan []ManagedChannelBalanceStateSettings, managedChannelBalanceStateSettings []ManagedChannelBalanceStateSettings)

func SendToManagedChannelChannel

func SendToManagedChannelChannel(ch chan ManagedChannel, managedChannel ManagedChannel)

func SendToManagedChannelGroupSettingsChannel added in v0.12.0

func SendToManagedChannelGroupSettingsChannel(ch chan *ManagedChannelGroupSettings, managedChannelGroupSettings *ManagedChannelGroupSettings)

func SendToManagedChannelIdsChannel added in v0.14.0

func SendToManagedChannelIdsChannel(ch chan []int, channelIds []int)

func SendToManagedChannelSettingChannel added in v0.13.0

func SendToManagedChannelSettingChannel(ch chan ManagedChannelSettings, channelSettings ManagedChannelSettings)

func SendToManagedChannelSettingsChannel

func SendToManagedChannelSettingsChannel(ch chan []ManagedChannelSettings, channelSettings []ManagedChannelSettings)

func SendToManagedChannelStateSettingsChannel added in v0.14.0

func SendToManagedChannelStateSettingsChannel(ch chan *ManagedChannelStateSettings, managedChannelStateSettings *ManagedChannelStateSettings)

func SendToManagedChannelStatesSettingsChannel added in v0.14.0

func SendToManagedChannelStatesSettingsChannel(ch chan []ManagedChannelStateSettings, managedChannelBalanceStateSettings []ManagedChannelStateSettings)

func SendToManagedNodeChannel

func SendToManagedNodeChannel(ch chan ManagedNode, managedNode ManagedNode)

func SendToManagedNodeIdsChannel

func SendToManagedNodeIdsChannel(ch chan []int, nodeIds []int)

func SendToManagedNodeSettingChannel added in v0.16.0

func SendToManagedNodeSettingChannel(ch chan ManagedNodeSettings, nodeSetting ManagedNodeSettings)

func SendToManagedNodeSettingsChannel

func SendToManagedNodeSettingsChannel(ch chan []ManagedNodeSettings, nodeSettings []ManagedNodeSettings)

func SendToManagedPublicKeysChannel

func SendToManagedPublicKeysChannel(ch chan []string, publicKeys []string)

func SendToManagedRebalanceChannel added in v0.16.0

func SendToManagedRebalanceChannel(ch chan ManagedRebalance, managedRebalance ManagedRebalance)

func SendToManagedRebalanceResultChannel added in v0.16.0

func SendToManagedRebalanceResultChannel(ch chan RebalanceResult, rebalanceResult RebalanceResult)

func SendToManagedSettingsChannel

func SendToManagedSettingsChannel(ch chan ManagedSettings, managedSettings ManagedSettings)

func SendToManagedTriggerSettingsChannel added in v0.16.0

func SendToManagedTriggerSettingsChannel(ch chan ManagedTriggerSettings, managedTriggerSettings ManagedTriggerSettings)

func SendToRebalancersChannel added in v0.16.0

func SendToRebalancersChannel(ch chan []*Rebalancer, rebalancers []*Rebalancer)

func SetChannel

func SetChannel(channelId int, shortChannelId *string, lndShortChannelId *uint64, status ChannelStatus,
	fundingTransactionHash string, fundingOutputIndex int,
	fundingBlockHeight *int64, fundedOn *time.Time,
	capacity int64, private bool, firstNodeId int, secondNodeId int,
	initiatingNodeId *int, acceptingNodeId *int,
	closingTransactionHash *string, closingNodeId *int, closingBlockHeight *int64, closedOn *time.Time)

func SetChannelGroupsByChannelId added in v0.12.0

func SetChannelGroupsByChannelId(channelId int, channelGroups []ChannelGroup)

func SetChannelNode

func SetChannelNode(nodeId int, publicKey string, chain Chain, network Network, status ChannelStatus)

func SetChannelStateBalanceHtlcEvent added in v0.14.0

func SetChannelStateBalanceHtlcEvent(htlcEvent HtlcEvent)

func SetChannelStateBalanceUpdate added in v0.14.0

func SetChannelStateBalanceUpdate(nodeId int, channelId int, increaseBalance bool, amount int64)

func SetChannelStateBalanceUpdateMsat added in v0.14.0

func SetChannelStateBalanceUpdateMsat(nodeId int, channelId int, increaseBalance bool, amount uint64)

func SetChannelStateChannelStatus added in v0.14.0

func SetChannelStateChannelStatus(nodeId int, channelId int, status Status)

func SetChannelStateNodeStatus added in v0.14.0

func SetChannelStateNodeStatus(nodeId int, status Status)

func SetChannelStateRoutingPolicy added in v0.14.0

func SetChannelStateRoutingPolicy(nodeId int, channelId int, local bool,
	disabled bool, timeLockDelta uint32, minHtlcMsat uint64, maxHtlcMsat uint64, feeBaseMsat uint64, feeRateMilliMsat uint64)

func SetChannelStates added in v0.14.0

func SetChannelStates(nodeId int, channelStateSettings []ManagedChannelStateSettings)

func SetChannelStatus

func SetChannelStatus(channelId int, status ChannelStatus)

func SetInactiveChannelNode

func SetInactiveChannelNode(nodeId int, publicKey string, chain Chain, network Network)

func SetRebalanceAndChannels added in v0.16.0

func SetRebalanceAndChannels(db *sqlx.DB, rebalancer Rebalancer) error

func SetSettings

func SetSettings(defaultDateRange, defaultLanguage, weekStartsOn, preferredTimeZone string)

func SetTorqNode

func SetTorqNode(nodeId int, name string, status Status, publicKey string, chain Chain, network Network)

SetTorqNode When active then also adds to channelNodes

func SetTrigger added in v0.16.0

func SetTrigger(nodeId int, reference string, workflowVersionId int, triggeringWorkflowVersionNodeId int, status Status, cancel context.CancelFunc)

func SetTriggerVerificationTime added in v0.16.0

func SetTriggerVerificationTime(nodeId int, workflowVersionId int, verificationTime time.Time)

Types

type Attempt added in v0.15.0

type Attempt struct {
	AttemptId     uint64         `json:"attemptId"`
	Status        string         `json:"status"`
	Route         Route          `json:"route"`
	AttemptTimeNs time.Time      `json:"attemptTimeNs"`
	ResolveTimeNs time.Time      `json:"resolveTimeNs"`
	Preimage      string         `json:"preimage"`
	Failure       FailureDetails `json:"failure"`
}

type BatchOpenChannel added in v0.15.0

type BatchOpenChannel struct {
	NodePubkey         string  `json:"nodePubkey"`
	LocalFundingAmount int64   `json:"localFundingAmount"`
	PushSat            *int64  `json:"pushSat"`
	Private            *bool   `json:"private"`
	MinHtlcMsat        *uint64 `json:"minHtlcMsat"`
}

BATCH OPEN CHANNELS

type BatchOpenRequest added in v0.15.0

type BatchOpenRequest struct {
	NodeId      int                `json:"nodeId"`
	Channels    []BatchOpenChannel `json:"channels"`
	TargetConf  *int32             `json:"targetConf"`
	SatPerVbyte *int64             `json:"satPerVbyte"`
}

type BatchOpenResponse added in v0.15.0

type BatchOpenResponse struct {
	PendingChannels []PendingChannel `json:"pendingChannels"`
}

type BlockEvent added in v0.13.0

type BlockEvent struct {
	EventData
	Height uint32 `json:"height"`
	Hash   []byte `json:"hash"`
}

type Chain

type Chain int

func GetChain

func GetChain(chain string) Chain

GetChain defaults to Bitcoin when no match is found

type ChannelBalanceEvent added in v0.16.0

type ChannelBalanceEvent struct {
	EventData
	ChannelId int `json:"channelId"`
	ChannelBalanceEventData
	PreviousEventData *ChannelBalanceEventData `json:"previous"`
}

type ChannelBalanceEventData added in v0.16.0

type ChannelBalanceEventData struct {
	Capacity                            int64 `json:"capacity"`
	LocalBalance                        int64 `json:"localBalance"`
	LocalBalancePerMilleRatio           int   `json:"localBalancePerMilleRatio"`
	RemoteBalance                       int64 `json:"remoteBalance"`
	AggregatedLocalBalance              int64 `json:"aggregatedLocalBalance"`
	AggregatedLocalBalancePerMilleRatio int   `json:"aggregatedLocalBalancePerMilleRatio"`
}

type ChannelBalanceStateHtlcInclude added in v0.14.0

type ChannelBalanceStateHtlcInclude uint
const (
	PENDING_HTLCS_IGNORED ChannelBalanceStateHtlcInclude = iota
	// PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_DOWNWARDS:
	//   LocalBalance = ConfirmedLocalBalance - PendingDecreasingForwardHTLCsAmount - PendingPaymentHTLCsAmount
	PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_DOWNWARDS
	// PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_DOWNWARDS:
	//   RemoteBalance = ConfirmedRemoteBalance - PendingIncreasingForwardHTLCsAmount - PendingInvoiceHTLCsAmount
	PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_DOWNWARDS
	// PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_DOWNWARDS:
	//   LocalBalance = ConfirmedLocalBalance - PendingDecreasingForwardHTLCsAmount - PendingPaymentHTLCsAmount
	//   RemoteBalance = ConfirmedRemoteBalance - PendingIncreasingForwardHTLCsAmount - PendingInvoiceHTLCsAmount
	PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_DOWNWARDS
	// PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_UPWARDS:
	//   LocalBalance = ConfirmedLocalBalance + PendingIncreasingForwardHTLCsAmount + PendingInvoiceHTLCsAmount
	PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_UPWARDS
	//   RemoteBalance = ConfirmedRemoteBalance + PendingDecreasingForwardHTLCsAmount + PendingPaymentHTLCsAmount
	PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_UPWARDS
	// PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_UPWARDS:
	//   LocalBalance = ConfirmedLocalBalance + PendingIncreasingForwardHTLCsAmount + PendingInvoiceHTLCsAmount
	//   RemoteBalance = ConfirmedRemoteBalance + PendingDecreasingForwardHTLCsAmount + PendingPaymentHTLCsAmount
	PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_UPWARDS
)

type ChannelEvent added in v0.13.0

type ChannelEvent struct {
	EventData
	Type      lnrpc.ChannelEventUpdate_UpdateType `json:"type"`
	ChannelId int                                 `json:"channelId"`
}

type ChannelGraphEvent added in v0.13.0

type ChannelGraphEvent struct {
	GraphEventData
	ChannelGraphEventData
	PreviousEventTime *time.Time             `json:"previousEventTime"`
	PreviousEventData *ChannelGraphEventData `json:"previous"`
}

type ChannelGraphEventData added in v0.13.0

type ChannelGraphEventData struct {
	Disabled         bool   `json:"disabled"`
	TimeLockDelta    uint32 `json:"timeLockDelta"`
	MinHtlcMsat      uint64 `json:"minHtlcMsat"`
	MaxHtlcMsat      uint64 `json:"maxHtlcMsat"`
	FeeBaseMsat      uint64 `json:"feeBaseMsat"`
	FeeRateMilliMsat uint64 `json:"feeRateMilliMsat"`
}

type ChannelGroup added in v0.12.0

type ChannelGroup struct {
	TagId         *int    `json:"tagId" db:"tag_id"`
	TagName       *string `json:"tagName" db:"tag_name"`
	TagStyle      *string `json:"tagStyle" db:"tag_style"`
	CategoryId    *int    `json:"categoryId" db:"category_id"`
	CategoryName  *string `json:"categoryName" db:"category_name"`
	CategoryStyle *string `json:"categoryStyle" db:"category_style"`
}

type ChannelGroupInclude added in v0.12.0

type ChannelGroupInclude uint
const (
	CATEGORIES_ONLY ChannelGroupInclude = iota
	DISTINCT_REGULAR_AND_TAG_CATEGORIES
	ALL_REGULAR_AND_TAG_CATEGORIES
	TAGS_ONLY
)

type ChannelPoint added in v0.15.0

type ChannelPoint struct {
	TxId        []byte `json:"txId"`
	OutputIndex uint32 `json:"outputIndex"`
}

type ChannelStateInclude added in v0.14.0

type ChannelStateInclude uint
const (
	ALL_LOCAL_ACTIVE_CHANNELS ChannelStateInclude = iota
	ALL_LOCAL_AND_REMOTE_ACTIVE_CHANNELS
	ALL_CHANNELS
)

type ChannelStatus

type ChannelStatus int

func GetChannelStatusByChannelId added in v0.13.0

func GetChannelStatusByChannelId(channelId int) ChannelStatus

type ChannelStatusUpdateRequest added in v0.16.0

type ChannelStatusUpdateRequest struct {
	ResponseChannel chan ChannelStatusUpdateResponse `json:"-"`
	CommunicationRequest
	ChannelId     int    `json:"channelId"`
	ChannelStatus Status `json:"channelStatus"`
}

type ChannelStatusUpdateResponse added in v0.16.0

type ChannelStatusUpdateResponse struct {
	Request ChannelStatusUpdateRequest `json:"request"`
	CommunicationResponse
}

type CloseChannelRequest added in v0.15.0

type CloseChannelRequest struct {
	NodeId          int     `json:"nodeId"`
	ChannelId       int     `json:"channelId"`
	Force           *bool   `json:"force"`
	TargetConf      *int32  `json:"targetConf"`
	DeliveryAddress *string `json:"deliveryAddress"`
	SatPerVbyte     *uint64 `json:"satPerVbyte"`
}

CLOSE CHANNEL

type CloseChannelResponse added in v0.15.0

type CloseChannelResponse struct {
	RequestId                string              `json:"requestId"`
	Request                  CloseChannelRequest `json:"request"`
	Status                   ChannelStatus       `json:"status"`
	ClosePendingChannelPoint ChannelPoint        `json:"closePendingChannelPoint"`
	CloseChannelStatus       CloseChannelStatus  `json:"closeChannelStatus"`
}

type CloseChannelStatus added in v0.15.0

type CloseChannelStatus struct {
	ClosingTxId []byte `json:"closingTxId"`
	Success     bool   `json:"success"`
}

type CommunicationRequest added in v0.16.0

type CommunicationRequest struct {
	RequestId   string     `json:"requestId"`
	RequestTime *time.Time `json:"requestTime"`
	NodeId      int        `json:"nodeId"`
}

Request/Response for lightningCommunication

type CommunicationResponse added in v0.16.0

type CommunicationResponse struct {
	Status  Status `json:"status"`
	Message string `json:"message"`
	Error   string `json:"error"`
}

type EventData added in v0.13.0

type EventData struct {
	EventTime time.Time `json:"eventTime"`
	NodeId    int       `json:"nodeId"`
}

type FailedRequest added in v0.15.0

type FailedRequest struct {
	Reason string `json:"reason"`
	Error  string `json:"error"`
}

GENERIC REQUEST/RESPONSE STRUCTS

type FailureDetails added in v0.15.0

type FailureDetails struct {
	Reason             string `json:"reason"`
	FailureSourceIndex uint32 `json:"failureSourceIndex"`
	Height             uint32 `json:"height"`
}

type ForwardEvent added in v0.13.0

type ForwardEvent struct {
	EventData
	Timestamp         time.Time `json:"timestamp"`
	FeeMsat           uint64    `json:"feeMsat"`
	AmountInMsat      uint64    `json:"amountInMsat"`
	AmountOutMsat     uint64    `json:"amountOutMsat"`
	OutgoingChannelId *int      `json:"outgoingChannelId"`
	IncomingChannelId *int      `json:"incomingChannelId"`
}

type GraphEventData added in v0.13.0

type GraphEventData struct {
	EventData
	EventNodeId      *int `json:"eventNodeId"`
	AnnouncingNodeId *int `json:"announcingNodeId"`
	ConnectingNodeId *int `json:"connectingNodeId"`
	ChannelId        *int `json:"channelId"`
}

type Hops added in v0.15.0

type Hops struct {
	ChanId           string    `json:"chanId"`
	Expiry           uint32    `json:"expiry"`
	AmtToForwardMsat int64     `json:"amtToForwardMsat"`
	PubKey           string    `json:"pubKey"`
	MppRecord        MppRecord `json:"mppRecord"`
}

type Htlc added in v0.14.0

type Htlc struct {
	Incoming         bool
	Amount           int64
	HashLock         []byte
	ExpirationHeight uint32
	// Index identifying the htlc on the channel.
	HtlcIndex uint64
	// If this HTLC is involved in a forwarding operation, this field indicates
	// the forwarding channel. For an outgoing htlc, it is the incoming channel.
	// For an incoming htlc, it is the outgoing channel. When the htlc
	// originates from this node or this node is the final destination,
	// forwarding_channel will be zero. The forwarding channel will also be zero
	// for htlcs that need to be forwarded but don't have a forwarding decision
	// persisted yet.
	ForwardingChannel uint64
	// Index identifying the htlc on the forwarding channel.
	ForwardingHtlcIndex uint64
}

type HtlcEvent added in v0.13.0

type HtlcEvent struct {
	EventData
	Timestamp         time.Time `json:"timestamp"`
	Data              string    `json:"data"`
	EventOrigin       *string   `json:"eventOrigin"`
	EventType         *string   `json:"eventType"`
	OutgoingHtlcId    *uint64   `json:"outgoingHtlcId"`
	IncomingHtlcId    *uint64   `json:"incomingHtlcId"`
	TimestampNs       *uint64   `json:"timestampNs"`
	IncomingAmtMsat   *uint64   `json:"incomingAmtMsat"`
	OutgoingAmtMsat   *uint64   `json:"outgoingAmtMsat"`
	IncomingTimelock  *uint32   `json:"incomingTimelock"`
	OutgoingTimelock  *uint32   `json:"outgoingTimelock"`
	BoltFailureCode   *string   `json:"boltFailureCode"`
	BoltFailureString *string   `json:"boltFailureString"`
	LndFailureDetail  *string   `json:"lndFailureDetail"`
	OutgoingChannelId *int      `json:"outgoingChannelId"`
	IncomingChannelId *int      `json:"incomingChannelId"`
}

type Implementation

type Implementation int

type ImportRequest added in v0.13.0

type ImportRequest struct {
	ImportType ImportType
	Out        chan error
}

type ImportType added in v0.13.0

type ImportType int

type InvoiceEvent added in v0.13.0

type InvoiceEvent struct {
	EventData
	ChannelId         int                        `json:"channelId"`
	AddIndex          uint64                     `json:"addIndex"`
	ValueMSat         uint64                     `json:"valueMSat"`
	State             lnrpc.Invoice_InvoiceState `json:"state"`
	AmountPaidMsat    uint64                     `json:"amountPaidMsat"`
	SettledDate       time.Time                  `json:"settledDate"`
	DestinationNodeId *int                       `json:"destinationNodeId"`
}

type ManagedChannel

type ManagedChannel struct {
	Type                   ManagedChannelCacheOperationType
	ChannelId              int
	ShortChannelId         string
	LndShortChannelId      uint64
	FundingTransactionHash string
	FundingOutputIndex     int
	FundingBlockHeight     *int64
	FundedOn               *time.Time
	Capacity               int64
	NodeId                 int
	FirstNodeId            int
	SecondNodeId           int
	InitiatingNodeId       *int
	AcceptingNodeId        *int
	Private                bool
	Status                 ChannelStatus
	ClosingTransactionHash *string
	ClosingNodeId          *int
	ClosingBlockHeight     *int64
	ClosedOn               *time.Time
	Out                    chan ManagedChannel
	ChannelSettingOut      chan ManagedChannelSettings
	ChannelSettingsOut     chan []ManagedChannelSettings
	ChannelIdsOut          chan []int
}

type ManagedChannelBalanceStateSettings added in v0.14.0

type ManagedChannelBalanceStateSettings struct {
	NodeId                     int                            `json:"nodeId"`
	RemoteNodeId               int                            `json:"remoteNodeId"`
	ChannelId                  int                            `json:"channelId"`
	HtlcInclude                ChannelBalanceStateHtlcInclude `json:"htlcInclude"`
	LocalBalance               int64                          `json:"localBalance"`
	LocalBalancePerMilleRatio  int                            `json:"localBalancePerMilleRatio"`
	RemoteBalance              int64                          `json:"remoteBalance"`
	RemoteBalancePerMilleRatio int                            `json:"remoteBalancePerMilleRatio"`
}

func GetChannelBalanceState added in v0.14.0

func GetChannelBalanceState(nodeId, channelId int, forceResponse bool, htlcInclude ChannelBalanceStateHtlcInclude) *ManagedChannelBalanceStateSettings

func GetChannelBalanceStates added in v0.14.0

func GetChannelBalanceStates(nodeId int, forceResponse bool, channelStateInclude ChannelStateInclude, htlcInclude ChannelBalanceStateHtlcInclude) []ManagedChannelBalanceStateSettings

type ManagedChannelCacheOperationType

type ManagedChannelCacheOperationType uint
const (
	// READ_ACTIVE_CHANNELID_BY_SHORTCHANNELID please provide ShortChannelId and Out
	READ_ACTIVE_CHANNELID_BY_SHORTCHANNELID ManagedChannelCacheOperationType = iota
	// READ_CHANNELID_BY_SHORTCHANNELID please provide ShortChannelId and Out
	READ_CHANNELID_BY_SHORTCHANNELID
	// READ_ACTIVE_CHANNELID_BY_FUNDING_TRANSACTION please provide FundingTransactionHash, FundingOutputIndex and Out
	READ_ACTIVE_CHANNELID_BY_FUNDING_TRANSACTION
	// READ_CHANNELID_BY_FUNDING_TRANSACTION please provide FundingTransactionHash, FundingOutputIndex and Out
	READ_CHANNELID_BY_FUNDING_TRANSACTION
	// READ_CHANNELIDS_BY_NODE_ID please provide NodeId and ChannelIdsOut
	READ_CHANNELIDS_BY_NODE_ID
	// READ_STATUSID_BY_CHANNELID please provide ChannelId and Out
	READ_STATUSID_BY_CHANNELID
	// READ_CHANNEL_SETTINGS please provide ChannelId and ChannelSettingOut
	READ_CHANNEL_SETTINGS
	// READ_ALL_CHANNEL_SETTINGS please provide FirstNodeId and ChannelSettingsOut
	READ_ALL_CHANNEL_SETTINGS
	// WRITE_CHANNEL Please provide ChannelId, FundingTransactionHash, FundingOutputIndex and Status (other values are optional in case of pending open channel)
	WRITE_CHANNEL
	// WRITE_CHANNELSTATUSID Please provide ChannelId and Status
	WRITE_CHANNELSTATUSID
)

type ManagedChannelGroup added in v0.12.0

type ManagedChannelGroup struct {
	Type          ManagedChannelGroupCacheOperationType
	ChannelId     int
	Include       ChannelGroupInclude
	ChannelGroups []ChannelGroup
	Out           chan *ManagedChannelGroupSettings
}

type ManagedChannelGroupCacheOperationType added in v0.12.0

type ManagedChannelGroupCacheOperationType uint
const (
	// READ_CHANNELGROUPS please provide ChannelId and Out
	READ_CHANNELGROUPS ManagedChannelGroupCacheOperationType = iota
	// WRITE_CHANNELGROUPS Please provide ChannelId, ChannelGroups
	WRITE_CHANNELGROUPS
)

type ManagedChannelGroupSettings added in v0.12.0

type ManagedChannelGroupSettings struct {
	ChannelId     int
	ChannelGroups []ChannelGroup
}

func GetChannelGroupsByChannelId added in v0.12.0

func GetChannelGroupsByChannelId(channelId int, include ChannelGroupInclude) *ManagedChannelGroupSettings

type ManagedChannelSettings

type ManagedChannelSettings struct {
	ChannelId              int
	ShortChannelId         string
	LndShortChannelId      uint64
	FundingTransactionHash string
	FundingOutputIndex     int
	FundingBlockHeight     *int64
	FundedOn               *time.Time
	Capacity               int64
	FirstNodeId            int
	SecondNodeId           int
	InitiatingNodeId       *int
	AcceptingNodeId        *int
	Private                bool
	Status                 ChannelStatus
	ClosingTransactionHash *string
	ClosingNodeId          *int
	ClosingBlockHeight     *int64
	ClosedOn               *time.Time
}

func GetChannelSettingByChannelId added in v0.13.0

func GetChannelSettingByChannelId(channelId int) ManagedChannelSettings

func GetChannelSettingsByNodeId added in v0.13.0

func GetChannelSettingsByNodeId(nodeId int) []ManagedChannelSettings

type ManagedChannelState added in v0.14.0

type ManagedChannelState struct {
	Type                 ManagedChannelStateCacheOperationType
	NodeId               int
	RemoteNodeId         int
	ChannelId            int
	Status               Status
	Local                bool
	Balance              int64
	Disabled             bool
	FeeBaseMsat          uint64
	FeeRateMilliMsat     uint64
	MinHtlcMsat          uint64
	MaxHtlcMsat          uint64
	TimeLockDelta        uint32
	Amount               int64
	ForceResponse        bool
	HtlcEvent            HtlcEvent
	ChannelStateSettings []ManagedChannelStateSettings
	HtlcInclude          ChannelBalanceStateHtlcInclude
	StateInclude         ChannelStateInclude
	StateOut             chan *ManagedChannelStateSettings
	StatesOut            chan []ManagedChannelStateSettings
	BalanceStateOut      chan *ManagedChannelBalanceStateSettings
	BalanceStatesOut     chan []ManagedChannelBalanceStateSettings
}

type ManagedChannelStateCacheOperationType added in v0.14.0

type ManagedChannelStateCacheOperationType uint
const (
	// READ_CHANNELSTATE please provide NodeId, ChannelId and StateOut
	READ_CHANNELSTATE ManagedChannelStateCacheOperationType = iota
	// READ_ALL_CHANNELSTATES please provide NodeId and StatesOut
	READ_ALL_CHANNELSTATES
	// READ_CHANNELBALANCESTATE please provide NodeId, ChannelId, HtlcInclude and BalanceStateOut
	READ_CHANNELBALANCESTATE
	// READ_ALL_CHANNELBALANCESTATES please provide NodeId, StateInclude, HtlcInclude and BalanceStatesOut
	READ_ALL_CHANNELBALANCESTATES
	// WRITE_INITIAL_CHANNELSTATES This requires the lock being active for writing! Please provide the complete information set
	WRITE_INITIAL_CHANNELSTATES
	WRITE_CHANNELSTATE_NODESTATUS
	WRITE_CHANNELSTATE_CHANNELSTATUS
	WRITE_CHANNELSTATE_ROUTINGPOLICY
	WRITE_CHANNELSTATE_UPDATEBALANCE
	WRITE_CHANNELSTATE_UPDATEHTLCEVENT
)

type ManagedChannelStateSettings added in v0.14.0

type ManagedChannelStateSettings struct {
	NodeId       int `json:"nodeId"`
	RemoteNodeId int `json:"remoteNodeId"`
	ChannelId    int `json:"channelId"`

	LocalBalance          int64  `json:"localBalance"`
	LocalDisabled         bool   `json:"localDisabled"`
	LocalFeeBaseMsat      uint64 `json:"localFeeBaseMsat"`
	LocalFeeRateMilliMsat uint64 `json:"localFeeRateMilliMsat"`
	LocalMinHtlcMsat      uint64 `json:"localMinHtlcMsat"`
	LocalMaxHtlcMsat      uint64 `json:"localMaxHtlcMsat"`
	LocalTimeLockDelta    uint32 `json:"localTimeLockDelta"`

	RemoteBalance          int64  `json:"remoteBalance"`
	RemoteDisabled         bool   `json:"remoteDisabled"`
	RemoteFeeBaseMsat      uint64 `json:"remoteFeeBaseMsat"`
	RemoteFeeRateMilliMsat uint64 `json:"remoteFeeRateMilliMsat"`
	RemoteMinHtlcMsat      uint64 `json:"remoteMinHtlcMsat"`
	RemoteMaxHtlcMsat      uint64 `json:"remoteMaxHtlcMsat"`
	RemoteTimeLockDelta    uint32 `json:"remoteTimeLockDelta"`

	UnsettledBalance int64 `json:"unsettledBalance"`

	PendingHtlcs []Htlc `json:"pendingHtlcs"`
	// INCREASING LOCAL BALANCE HTLCs
	PendingIncomingHtlcCount  int   `json:"pendingIncomingHtlcCount"`
	PendingIncomingHtlcAmount int64 `json:"pendingIncomingHtlcAmount"`
	// DECREASING LOCAL BALANCE HTLCs
	PendingOutgoingHtlcCount  int   `json:"pendingOutgoingHtlcCount"`
	PendingOutgoingHtlcAmount int64 `json:"pendingOutgoingHtlcAmount"`

	// STALE INFORMATION ONLY OBTAINED VIA LND REGULAR CHECKINS SO NOT MAINTAINED
	CommitFee             int64                `json:"commitFee"`
	CommitWeight          int64                `json:"commitWeight"`
	FeePerKw              int64                `json:"feePerKw"`
	NumUpdates            uint64               `json:"numUpdates"`
	ChanStatusFlags       string               `json:"chanStatusFlags"`
	CommitmentType        lnrpc.CommitmentType `json:"commitmentType"`
	Lifetime              int64                `json:"lifetime"`
	TotalSatoshisReceived int64                `json:"totalSatoshisReceived"`
	TotalSatoshisSent     int64                `json:"totalSatoshisSent"`
}

func GetChannelState added in v0.14.0

func GetChannelState(nodeId, channelId int, forceResponse bool) *ManagedChannelStateSettings

func GetChannelStates added in v0.14.0

func GetChannelStates(nodeId int, forceResponse bool) []ManagedChannelStateSettings

type ManagedNode

type ManagedNode struct {
	Type            ManagedNodeCacheOperationType
	NodeId          int
	Chain           *Chain
	Network         *Network
	PublicKey       string
	Name            *string
	Out             chan ManagedNode
	NodeIdsOut      chan []int
	NodeSettingOut  chan ManagedNodeSettings
	NodeSettingsOut chan []ManagedNodeSettings
	PublicKeysOut   chan []string
}

type ManagedNodeCacheOperationType

type ManagedNodeCacheOperationType uint
const (
	READ_ALL_TORQ_NODE ManagedNodeCacheOperationType = iota
	WRITE_INACTIVE_TORQ_NODE
	READ_ALL_TORQ_NODEIDS
	READ_ALL_TORQ_PUBLICKEYS
	READ_ACTIVE_TORQ_NODE
	WRITE_ACTIVE_TORQ_NODE
	READ_ACTIVE_TORQ_NODEIDS
	READ_ACTIVE_TORQ_PUBLICKEYS
	READ_ALL_ACTIVE_TORQ_NODEIDS
	READ_ALL_ACTIVE_TORQ_NODESETTINGS
	READ_ACTIVE_CHANNEL_NODE
	READ_CHANNEL_NODE
	WRITE_ACTIVE_CHANNEL_NODE
	WRITE_INACTIVE_CHANNEL_NODE
	INACTIVATE_CHANNEL_NODE
	READ_ALL_CHANNEL_NODEIDS
	READ_ALL_CHANNEL_PUBLICKEYS
	READ_NODE_SETTING
)

type ManagedNodeSettings

type ManagedNodeSettings struct {
	NodeId    int
	Chain     Chain
	Network   Network
	PublicKey string
	Name      *string
	Status    Status
}

func GetActiveTorqNodeSettings added in v0.16.0

func GetActiveTorqNodeSettings() []ManagedNodeSettings

func GetNodeSettingsByNodeId

func GetNodeSettingsByNodeId(nodeId int) ManagedNodeSettings

type ManagedRebalance added in v0.16.0

type ManagedRebalance struct {
	Type               ManagedRebalanceCacheOperationType
	Origin             RebalanceRequestOrigin
	OriginId           int
	OriginReference    string
	IncomingChannelId  int
	IncomingPublicKey  string
	OutgoingChannelId  int
	OutgoingPublicKey  string
	AmountMsat         uint64
	Status             *Status
	Rebalancer         *Rebalancer
	RebalanceResult    RebalanceResult
	Out                chan ManagedRebalance
	BoolOut            chan bool
	RebalanceResultOut chan RebalanceResult
	RebalancersOut     chan []*Rebalancer
}

type ManagedRebalanceCacheOperationType added in v0.16.0

type ManagedRebalanceCacheOperationType uint
const (
	READ_REBALANCER ManagedRebalanceCacheOperationType = iota
	READ_REBALANCERS
	WRITE_REBALANCER
	DELETE_REBALANCER
	READ_REBALANCE_RESULT
	READ_REBALANCE_RESULT_BY_ORIGIN
	WRITE_REBALANCE_RESULT
)

type ManagedSettings

type ManagedSettings struct {
	Type              ManagedSettingsCacheOperationType
	DefaultLanguage   string
	PreferredTimeZone string
	DefaultDateRange  string
	WeekStartsOn      string
	Out               chan ManagedSettings
}

func GetSettings

func GetSettings() ManagedSettings

type ManagedSettingsCacheOperationType

type ManagedSettingsCacheOperationType uint
const (
	// READ_SETTINGS please provide Out
	READ_SETTINGS ManagedSettingsCacheOperationType = iota
	// WRITE_SETTINGS please provide defaultLanguage, preferredTimeZone, defaultDateRange and weekStartsOn
	WRITE_SETTINGS
)

type ManagedTrigger added in v0.16.0

type ManagedTrigger struct {
	Type                            ManagedTriggerCacheOperationType
	NodeId                          int
	WorkflowVersionId               int
	TriggeringWorkflowVersionNodeId int
	Reference                       string
	CancelFunction                  context.CancelFunc
	PreviousState                   string
	BootTime                        *time.Time
	VerificationTime                *time.Time
	Status                          Status
	TriggerSettingsOut              chan ManagedTriggerSettings
}

type ManagedTriggerCacheOperationType added in v0.16.0

type ManagedTriggerCacheOperationType uint
const (
	READ_TRIGGER_SETTINGS ManagedTriggerCacheOperationType = iota
	WRITE_TRIGGER
	WRITE_TRIGGER_VERIFICATIONTIME
)

type ManagedTriggerSettings added in v0.16.0

type ManagedTriggerSettings struct {
	WorkflowVersionId               int
	NodeId                          int
	TriggeringWorkflowVersionNodeId int
	Reference                       string
	CancelFunction                  context.CancelFunc
	PreviousState                   string
	BootTime                        *time.Time
	VerificationTime                *time.Time
	Status                          Status
}

func GetTriggerSettingsByWorkflowVersionId added in v0.16.0

func GetTriggerSettingsByWorkflowVersionId(nodeId int, workflowVersionId int) ManagedTriggerSettings

type MppRecord added in v0.15.0

type MppRecord struct {
	PaymentAddr  string
	TotalAmtMsat int64
}

type Network

type Network int

func GetNetwork

func GetNetwork(network string) Network

GetNetwork defaults to MainNet when no match is found

type NewAddressRequest added in v0.15.0

type NewAddressRequest struct {
	NodeId int   `json:"nodeId"`
	Type   int32 `json:"type"`
	//The name of the account to generate a new address for. If empty, the default wallet account is used.
	Account string `json:"account"`
}

NEW ADDRESS

type NewAddressResponse added in v0.15.0

type NewAddressResponse struct {
	RequestId string            `json:"requestId"`
	Request   NewAddressRequest `json:"request"`
	Address   string            `json:"address"`
}

type NewPaymentRequest added in v0.15.0

type NewPaymentRequest struct {
	NodeId           int     `json:"nodeId"`
	Invoice          *string `json:"invoice"`
	TimeOutSecs      int32   `json:"timeoutSecs"`
	Dest             *string `json:"dest"`
	AmtMSat          *int64  `json:"amtMSat"`
	FeeLimitMsat     *int64  `json:"feeLimitMsat"`
	AllowSelfPayment *bool   `json:"allowSelfPayment"`
}

NEW PAYMENT

type NewPaymentResponse added in v0.15.0

type NewPaymentResponse struct {
	RequestId      string            `json:"requestId"`
	Request        NewPaymentRequest `json:"request"`
	Status         string            `json:"status"`
	FailureReason  string            `json:"failureReason"`
	Hash           string            `json:"hash"`
	Preimage       string            `json:"preimage"`
	PaymentRequest string            `json:"paymentRequest"`
	AmountMsat     int64             `json:"amountMsat"`
	FeeLimitMsat   int64             `json:"feeLimitMsat"`
	FeePaidMsat    int64             `json:"feePaidMsat"`
	CreationDate   time.Time         `json:"creationDate"`
	Attempt        Attempt           `json:"path"`
}

type NodeConnectionDetailCustomSettings added in v0.13.0

type NodeConnectionDetailCustomSettings byte
const (
	ImportFailedPayments NodeConnectionDetailCustomSettings = 1 << iota
)

type NodeGraphEvent added in v0.13.0

type NodeGraphEvent struct {
	GraphEventData
	NodeGraphEventData
	PreviousEventTime *time.Time          `json:"previousEventTime"`
	PreviousEventData *NodeGraphEventData `json:"previous"`
}

type NodeGraphEventData added in v0.13.0

type NodeGraphEventData struct {
	Alias     string `json:"alias"`
	Color     string `json:"color"`
	Addresses string `json:"addresses"`
	Features  string `json:"features"`
}

type OpenChannelRequest added in v0.15.0

type OpenChannelRequest struct {
	NodeId             int     `json:"nodeId"`
	SatPerVbyte        *uint64 `json:"satPerVbyte"`
	NodePubKey         string  `json:"nodePubKey"`
	Host               *string `json:"host"`
	LocalFundingAmount int64   `json:"localFundingAmount"`
	PushSat            *int64  `json:"pushSat"`
	TargetConf         *int32  `json:"targetConf"`
	Private            *bool   `json:"private"`
	MinHtlcMsat        *uint64 `json:"minHtlcMsat"`
	RemoteCsvDelay     *uint32 `json:"remoteCsvDelay"`
	MinConfs           *int32  `json:"minConfs"`
	SpendUnconfirmed   *bool   `json:"spendUnconfirmed"`
	CloseAddress       *string `json:"closeAddress"`
}

OPEN CHANNEL

type OpenChannelResponse added in v0.15.0

type OpenChannelResponse struct {
	RequestId           string             `json:"requestId"`
	Request             OpenChannelRequest `json:"request"`
	Status              ChannelStatus      `json:"status"`
	ChannelPoint        string             `json:"channelPoint,omitempty"`
	PendingChannelPoint string             `json:"pendingChannelPoint,omitempty"`
}

type PayOnChainRequest added in v0.15.0

type PayOnChainRequest struct {
	NodeId           int     `json:"nodeId"`
	Address          string  `json:"address"`
	AmountSat        int64   `json:"amountSat"`
	TargetConf       *int32  `json:"targetConf"`
	SatPerVbyte      *uint64 `json:"satPerVbyte"`
	SendAll          *bool   `json:"sendAll"`
	Label            *string `json:"label"`
	MinConfs         *int32  `json:"minConfs"`
	SpendUnconfirmed *bool   `json:"spendUnconfirmed"`
}

PAY ONCHAIN

type PayOnChainResponse added in v0.15.0

type PayOnChainResponse struct {
	Request PayOnChainRequest `json:"request"`
	TxId    string            `json:"txId"`
}

type PaymentEvent added in v0.14.0

type PaymentEvent struct {
	EventData
	AmountPaid           int64                       `json:"amountPaid"`
	FeeMsat              uint64                      `json:"feeMsat"`
	PaymentStatus        lnrpc.Payment_PaymentStatus `json:"paymentStatus"`
	PaymentFailureReason lnrpc.PaymentFailureReason  `json:"paymentFailureReason"`
	OutgoingChannelId    *int                        `json:"outgoingChannelId"`
	RebalanceAmountMsat  *uint64                     `json:"rebalanceAmount"`
	IncomingChannelId    *int                        `json:"incomingChannelId"`
}

type PeerEvent added in v0.13.0

type PeerEvent struct {
	EventData
	Type        lnrpc.PeerEvent_EventType `json:"type"`
	EventNodeId int                       `json:"eventNodeId"`
}

type PendingChannel added in v0.15.0

type PendingChannel struct {
	PendingChannelPoint string `json:"pendingChannelPoint"`
}

type PingSystem added in v0.11.0

type PingSystem byte
const (
	Amboss PingSystem = 1 << iota
	Vector
)

type RebalanceRequest added in v0.16.0

type RebalanceRequest struct {
	CommunicationRequest
	ResponseChannel chan RebalanceResponse `json:"-"`
	Origin          RebalanceRequestOrigin `json:"origin"`
	// Either manually generated number for manual rebalance or
	// WorkflowVersionNodeId for rebalance originating from workflows
	OriginId        int    `json:"originId"`
	OriginReference string `json:"originReference"`
	// Either IncomingChannelId is populated or OutgoingChannelId is.
	IncomingChannelId int `json:"incomingChannelId"`
	// Either OutgoingChannelId is populated or IncomingChannelId is.
	OutgoingChannelId  int    `json:"outgoingChannelIds"`
	ChannelIds         []int  `json:"channelIds"`
	AmountMsat         uint64 `json:"amountMsat"`
	MaximumCostMsat    uint64 `json:"maximumCostMsat"`
	MaximumConcurrency int    `json:"maximumConcurrency"`
}

type RebalanceRequestOrigin added in v0.16.0

type RebalanceRequestOrigin int

type RebalanceResponse added in v0.16.0

type RebalanceResponse struct {
	Request RebalanceRequest `json:"request"`
	CommunicationResponse
}

type RebalanceResult added in v0.16.0

type RebalanceResult struct {
	RebalanceId       int       `json:"rebalanceId"`
	OutgoingChannelId int       `json:"outgoingChannelId"`
	IncomingChannelId int       `json:"incomingChannelId"`
	Status            Status    `json:"status"`
	Hops              string    `json:"hops"`
	TotalTimeLock     uint32    `json:"total_time_lock"`
	TotalFeeMsat      uint64    `json:"total_fee_msat"`
	TotalAmountMsat   uint64    `json:"total_amount_msat"`
	Error             string    `json:"error"`
	CreatedOn         time.Time `json:"createdOn"`
	UpdateOn          time.Time `json:"updateOn"`

	Route *lnrpc.Route `json:"-"`
}

type RebalanceRunner added in v0.16.0

type RebalanceRunner struct {
	RebalanceId       int
	OutgoingChannelId int
	IncomingChannelId int
	Invoices          map[uint64]*lnrpc.AddInvoiceResponse
	// FailedHops map[hopSourcePublicKey_hopDestinationPublicKey]amountMsat
	FailedHops  map[string]uint64
	FailedPairs []*lnrpc.NodePair
	Status      Status
	Ctx         context.Context
	Cancel      context.CancelFunc
}

type Rebalancer added in v0.16.0

type Rebalancer struct {
	NodeId          int
	RebalanceId     int
	Status          Status
	CreatedOn       time.Time
	UpdateOn        time.Time
	GlobalCtx       context.Context
	RebalanceCtx    context.Context
	RebalanceCancel context.CancelFunc
	Runners         map[int]*RebalanceRunner
	Request         RebalanceRequest
}

type Route added in v0.15.0

type Route struct {
	TotalTimeLock uint32 `json:"totalTimeLock"`
	Hops          []Hops `json:"hops"`
	TotalAmtMsat  int64  `json:"totalAmtMsat"`
}

type RoutingPolicyUpdateRequest added in v0.16.0

type RoutingPolicyUpdateRequest struct {
	CommunicationRequest
	ResponseChannel  chan RoutingPolicyUpdateResponse `json:"-"`
	ChannelId        int                              `json:"channelId"`
	FeeRateMilliMsat *uint64                          `json:"feeRateMilliMsat"`
	FeeBaseMsat      *uint64                          `json:"feeBaseMsat"`
	MaxHtlcMsat      *uint64                          `json:"maxHtlcMsat"`
	MinHtlcMsat      *uint64                          `json:"minHtlcMsat"`
	TimeLockDelta    *uint32                          `json:"timeLockDelta"`
}

type RoutingPolicyUpdateResponse added in v0.16.0

type RoutingPolicyUpdateResponse struct {
	Request RoutingPolicyUpdateRequest `json:"request"`
	CommunicationResponse
	FailedUpdates []FailedRequest `json:"failedUpdates"`
}

type ServiceChannelMessage added in v0.11.0

type ServiceChannelMessage = struct {
	ServiceType    ServiceType
	ServiceCommand ServiceCommand
	NodeId         int
	// EnforcedServiceStatus is a one time status enforcement for a service
	EnforcedServiceStatus *Status
	// NoDelay is a one time no delay enforcement for a service
	NoDelay bool
	Out     chan Status
}

type ServiceCommand added in v0.11.0

type ServiceCommand int

type ServiceEvent added in v0.13.0

type ServiceEvent struct {
	EventData
	Type               ServiceType
	SubscriptionStream *SubscriptionStream
	Status             Status
	PreviousStatus     Status
}

type ServiceType added in v0.11.0

type ServiceType int

func GetServiceTypes added in v0.16.0

func GetServiceTypes() []ServiceType

type Services added in v0.13.0

type Services struct {
	ServiceType ServiceType
	// contains filtered or unexported fields
}

func (*Services) AddSubscription added in v0.13.0

func (rs *Services) AddSubscription(nodeId int, cancelFunc func()) Status

func (*Services) Booted added in v0.13.0

func (rs *Services) Booted(nodeId int, bootLock *sync.Mutex) Status

func (*Services) Cancel added in v0.13.0

func (rs *Services) Cancel(nodeId int, enforcedServiceStatus *Status, noDelay bool) (Status, Status)

func (*Services) GetActiveNodeIds added in v0.13.0

func (rs *Services) GetActiveNodeIds() []int

func (*Services) GetBootLock added in v0.13.0

func (rs *Services) GetBootLock(nodeId int) *sync.Mutex

func (*Services) GetBootTime added in v0.13.0

func (rs *Services) GetBootTime(nodeId int) *time.Time

GetBootTime When the service is active it will return it's boot time

func (*Services) GetChannelBalanceCacheStreamStatus added in v0.13.0

func (rs *Services) GetChannelBalanceCacheStreamStatus(nodeId int) Status

func (*Services) GetEnforcedServiceStatusCheck added in v0.13.0

func (rs *Services) GetEnforcedServiceStatusCheck(nodeId int) *Status

func (*Services) GetIncludeIncomplete added in v0.13.0

func (rs *Services) GetIncludeIncomplete(nodeId int) bool

func (*Services) GetNodeIds added in v0.13.0

func (rs *Services) GetNodeIds() []int

func (*Services) GetStatus added in v0.13.0

func (rs *Services) GetStatus(nodeId int) Status

GetStatus return the status of the Service but in case of ServiceType = LndSubscription then streamStatuses are also verified. If one of the streamStatuses is not active then this function return Pending

func (*Services) GetStreamBootTime added in v0.13.0

func (rs *Services) GetStreamBootTime(nodeId int, stream SubscriptionStream) *time.Time

GetStreamBootTime when the status of the LND Service is active and streamStatus is active then bootTime will have a value

func (*Services) GetStreamInitializationPingTime added in v0.13.0

func (rs *Services) GetStreamInitializationPingTime(nodeId int, stream SubscriptionStream) *time.Time

func (*Services) GetStreamStatus added in v0.13.0

func (rs *Services) GetStreamStatus(nodeId int, stream SubscriptionStream) Status

GetStreamStatus when the status of the LND Service is active then streamStatus will be returned.

func (*Services) Initialising added in v0.14.0

func (rs *Services) Initialising(nodeId int) Status

func (*Services) IsNoDelay added in v0.13.0

func (rs *Services) IsNoDelay(nodeId int) bool

func (*Services) RemoveSubscription added in v0.13.0

func (rs *Services) RemoveSubscription(nodeId int) Status

func (*Services) SetIncludeIncomplete added in v0.13.0

func (rs *Services) SetIncludeIncomplete(nodeId int, includeIncomplete bool)

func (*Services) SetStreamStatus added in v0.13.0

func (rs *Services) SetStreamStatus(nodeId int, stream SubscriptionStream, status Status) Status

type ShortChannelIdHttpRequest added in v0.16.2

type ShortChannelIdHttpRequest struct {
	TransactionHash string `json:"transactionHash"`
	OutputIndex     int    `json:"outputIndex"`
	UnixTime        int64  `json:"unixTime"`
	Signature       string `json:"signature"`
	PublicKey       string `json:"publicKey"`
}

type ShortChannelIdHttpResponse added in v0.16.2

type ShortChannelIdHttpResponse struct {
	Request        ShortChannelIdHttpRequest `json:"request"`
	ShortChannelId string                    `json:"shortChannelId"`
}

type ShortChannelIdRequest added in v0.16.2

type ShortChannelIdRequest struct {
	CommunicationRequest
	ResponseChannel chan ShortChannelIdResponse `json:"-"`
	TransactionHash string                      `json:"transactionHash"`
	OutputIndex     int                         `json:"outputIndex"`
}

Request/Response for Vector

type ShortChannelIdResponse added in v0.16.2

type ShortChannelIdResponse struct {
	Request ShortChannelIdRequest `json:"request"`
	CommunicationResponse
	ShortChannelId string `json:"shortChannelId"`
}

type SignMessageRequest added in v0.16.2

type SignMessageRequest struct {
	CommunicationRequest
	ResponseChannel chan SignMessageResponse `json:"-"`
	Message         string                   `json:"message"`
}

type SignMessageResponse added in v0.16.2

type SignMessageResponse struct {
	Request SignMessageRequest `json:"request"`
	CommunicationResponse
	Signature string `json:"signature"`
}

type SignatureVerificationRequest added in v0.16.2

type SignatureVerificationRequest struct {
	CommunicationRequest
	ResponseChannel chan SignatureVerificationResponse `json:"-"`
	Message         string                             `json:"message"`
	Signature       string                             `json:"signature"`
}

type SignatureVerificationResponse added in v0.16.2

type SignatureVerificationResponse struct {
	Request SignatureVerificationRequest `json:"request"`
	CommunicationResponse
	PublicKey string `json:"publicKey"`
}

type Status

type Status int

type SubscriptionStream added in v0.13.0

type SubscriptionStream int

func (*SubscriptionStream) IsChannelBalanceCache added in v0.13.0

func (ss *SubscriptionStream) IsChannelBalanceCache() bool

type TransactionDetailsHttpRequest added in v0.16.4

type TransactionDetailsHttpRequest struct {
	TransactionHash string `json:"transactionHash"`
	UnixTime        int64  `json:"unixTime"`
	Signature       string `json:"signature"`
	PublicKey       string `json:"publicKey"`
}

type TransactionDetailsHttpResponse added in v0.16.4

type TransactionDetailsHttpResponse struct {
	Request          TransactionDetailsHttpRequest `json:"request"`
	TransactionCount int                           `json:"transactionCount"`
	TransactionIndex int                           `json:"transactionIndex"`
	BlockHash        string                        `json:"blockHash"`
	BlockTimestamp   time.Time                     `json:"blockTimestamp"`
	BlockHeight      int64                         `json:"blockHeight"`
}

func GetTransactionDetailsFromVector added in v0.16.4

func GetTransactionDetailsFromVector(transactionHash string, nodeSettings ManagedNodeSettings,
	lightningRequestChannel chan interface{}) TransactionDetailsHttpResponse

type TransactionEvent added in v0.13.0

type TransactionEvent struct {
	EventData
	Timestamp             time.Time `json:"timestamp"`
	TransactionHash       *string   `json:"transactionHash"`
	Amount                *int64    `json:"amount"`
	NumberOfConfirmations *int32    `json:"numberOfConfirmations"`
	BlockHash             *string   `json:"blockHash"`
	BlockHeight           *int32    `json:"blockHeight"`
	TotalFees             *int64    `json:"totalFees"`
	DestinationAddresses  *[]string `json:"destinationAddresses"`
	RawTransactionHex     *string   `json:"rawTransactionHex"`
	Label                 *string   `json:"label"`
}

type WorkflowNodeType added in v0.16.0

type WorkflowNodeType int

type WorkflowNodeTypeParameters added in v0.16.0

type WorkflowNodeTypeParameters struct {
	WorkflowNodeType WorkflowNodeType
	RequiredInputs   []WorkflowParameterWithLabel
	OptionalInputs   []WorkflowParameterWithLabel
	RequiredOutputs  []WorkflowParameterWithLabel
	OptionalOutputs  []WorkflowParameterWithLabel
}

type WorkflowParameter added in v0.16.0

type WorkflowParameter string

type WorkflowParameterType added in v0.16.0

type WorkflowParameterType int

type WorkflowParameterWithLabel added in v0.16.0

type WorkflowParameterWithLabel struct {
	Label string
	WorkflowParameter
}

type WorkflowTriggerType added in v0.16.0

type WorkflowTriggerType int

Jump to

Keyboard shortcuts

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