2019-03-15 16:02:16 +00:00
|
|
|
package backend
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/edouardparis/lntop/network/models"
|
|
|
|
"github.com/edouardparis/lntop/network/options"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Backend interface {
|
2019-04-05 15:00:25 +00:00
|
|
|
Ping() error
|
|
|
|
|
2019-03-15 16:02:16 +00:00
|
|
|
SubscribeInvoice(context.Context, chan *models.Invoice) error
|
|
|
|
|
2019-03-27 12:32:23 +00:00
|
|
|
SubscribeChannels(context.Context, chan *models.ChannelUpdate) error
|
|
|
|
|
2019-03-15 16:02:16 +00:00
|
|
|
NodeName() string
|
|
|
|
|
2019-04-04 11:06:38 +00:00
|
|
|
Info(context.Context) (*models.Info, error)
|
|
|
|
|
|
|
|
GetNode(context.Context, string) (*models.Node, error)
|
2019-03-22 16:20:41 +00:00
|
|
|
|
2019-03-15 16:02:16 +00:00
|
|
|
GetWalletBalance(context.Context) (*models.WalletBalance, error)
|
|
|
|
|
2019-03-29 11:38:09 +00:00
|
|
|
GetChannelsBalance(context.Context) (*models.ChannelsBalance, error)
|
2019-03-15 16:02:16 +00:00
|
|
|
|
|
|
|
ListChannels(context.Context, ...options.Channel) ([]*models.Channel, error)
|
|
|
|
|
2019-04-04 08:09:58 +00:00
|
|
|
GetChannelInfo(context.Context, *models.Channel) error
|
|
|
|
|
2019-03-15 16:02:16 +00:00
|
|
|
CreateInvoice(context.Context, int64, string) (*models.Invoice, error)
|
|
|
|
|
|
|
|
GetInvoice(context.Context, string) (*models.Invoice, error)
|
|
|
|
|
|
|
|
DecodePayReq(context.Context, string) (*models.PayReq, error)
|
|
|
|
|
|
|
|
SendPayment(context.Context, *models.PayReq) (*models.Payment, error)
|
2019-05-14 16:13:59 +00:00
|
|
|
|
|
|
|
GetTransactions(context.Context) ([]*models.Transaction, error)
|
|
|
|
|
|
|
|
SubscribeTransactions(context.Context, chan *models.Transaction) error
|
2021-05-09 21:37:01 +00:00
|
|
|
|
|
|
|
SubscribeRoutingEvents(context.Context, chan *models.RoutingEvent) error
|
2019-03-15 16:02:16 +00:00
|
|
|
}
|