Documentation ¶
Index ¶
- func NewLnurlLSP(lnurl string) (*lnurlLSP, error)
- func NewRegularLSP(lspID string) *regularLSP
- func NewRpcSigner(s signrpc.SignerClient) *rpcSigner
- func NewRpcUtxoSource(c lnrpc.LightningClient) *rpcUtxoSource
- type LnurlPayMetadata
- type LoginResponse
- type PaymentResponse
- type Service
- func (a *Service) AddInvoice(invoiceRequest *data.AddInvoiceRequest) (paymentRequest string, lspFee int64, err error)
- func (a *Service) CloseChannels(address string) (*data.CloseChannelsReply, error)
- func (a *Service) ConnectChannelsPeers() error
- func (a *Service) ConnectLSPPeer(lspID string) error
- func (a *Service) ConnectPeer(pubkey, host string) error
- func (a *Service) DecodePaymentRequest(paymentRequest string) (*data.InvoiceMemo, error)
- func (a *Service) DecryptLNUrlPayMessage(paymentHash string, preimage []byte) (string, error)
- func (a *Service) EnableAccount(enabled bool) error
- func (a *Service) FinishLNURLAuth(authParams *data.LNURLAuth) (string, error)
- func (a *Service) FinishLNURLPay(params *data.LNURLPayResponse1) (*data.LNUrlPayInfo, error)
- func (a *Service) FinishLNURLWithdraw(bolt11 string) (err error)
- func (a *Service) GetAccountInfo() (*data.Account, error)
- func (a *Service) GetAccountLimits() (maxReceive, maxPay, maxReserve int64, err error)
- func (a *Service) GetDefaultSatPerByteFee() (int64, error)
- func (a *Service) GetGlobalMaxReceiveLimit() (maxReceive int64, err error)
- func (a *Service) GetKeyPair() (string, error)
- func (a *Service) GetMaxAmount(destination string, routeHints []*lnrpc.RouteHint, lastHopPubkey []byte) (uint64, error)
- func (a *Service) GetPaymentRequestHash(paymentRequest string) (string, error)
- func (a *Service) GetPayments() (*data.PaymentsList, error)
- func (a *Service) GetRelatedInvoice(paymentRequest string) (*data.Invoice, error)
- func (a *Service) HandleLNURL(rawString string) (result *data.LNUrlResponse, err error)
- func (a *Service) LSPActivity(lspList *data.LSPList) (*data.LSPActivity, error)
- func (a *Service) OnResume()
- func (a *Service) OpenDirectLnurlChannel(k1, callback, URI string) error
- func (a *Service) OpenLSPChannel(lspID string) error
- func (a *Service) OpenLnurlChannel(lnurl string) error
- func (a *Service) PublishTransaction(txHex []byte) error
- func (a *Service) RegisterChannelOpenedNotification(token string) error
- func (a *Service) RegisterPeriodicSync(token string) error
- func (a *Service) RegisterReceivePaymentReadyNotification(token string) error
- func (a *Service) SendPaymentFailureBugReport(jsonReport string) error
- func (a *Service) SendPaymentForRequest(paymentRequest string, amountSatoshi int64, fee int64) (string, error)
- func (a *Service) SendPaymentForRequestV2(paymentRequest string, amountSatoshi int64, lastHopPubkey []byte, fee int64) (string, error)
- func (a *Service) SendSpontaneousPayment(destNode string, description string, amount int64, feeLimitMSat int64, ...) (string, error)
- func (a *Service) SendWalletCoins(address string, satPerByteFee int64) (string, error)
- func (a *Service) Start() error
- func (a *Service) Stop() error
- func (a *Service) SweepAllCoinsTransactions(address string) (*data.SweepAllCoinsTransactions, error)
- func (a *Service) ValidateAddress(address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLnurlLSP ¶
func NewRegularLSP ¶
func NewRegularLSP(lspID string) *regularLSP
func NewRpcSigner ¶
func NewRpcSigner(s signrpc.SignerClient) *rpcSigner
func NewRpcUtxoSource ¶
func NewRpcUtxoSource(c lnrpc.LightningClient) *rpcUtxoSource
Types ¶
type LnurlPayMetadata ¶
type LnurlPayMetadata struct {
// contains filtered or unexported fields
}
Service is the account service that controls all aspects of routing node connection and user channels as an abstracted account.
type LoginResponse ¶
type LoginResponse struct { lnurl.LNURLResponse Token string `json:"token"` }
type PaymentResponse ¶
PaymentResponse is the response of a payment attempt.
type Service ¶
func NewService ¶
func NewService( cfg *config.Config, breezDB *db.DB, breezAPI services.API, daemonAPI lnnode.API, requestBackup func(), onServiceEvent func(data.NotificationEvent)) (*Service, error)
NewService creates a new account service
func (*Service) AddInvoice ¶
func (a *Service) AddInvoice(invoiceRequest *data.AddInvoiceRequest) (paymentRequest string, lspFee int64, err error)
AddInvoice encapsulate a given amount and description in a payment request
func (*Service) CloseChannels ¶
func (a *Service) CloseChannels(address string) (*data.CloseChannelsReply, error)
CloseChannels attempts to cooperatively close all channels, sending the funds to the specified address.
func (*Service) ConnectChannelsPeers ¶
ConnectChannelsPeers connects to all peers associated with a non active channel.
func (*Service) ConnectLSPPeer ¶
ConnectLSPPeer connects to the LSP peer.
func (*Service) ConnectPeer ¶
func (*Service) DecodePaymentRequest ¶
func (a *Service) DecodePaymentRequest(paymentRequest string) (*data.InvoiceMemo, error)
DecodePaymentRequest is used by the payer to decode the payment request and read the invoice details.
func (*Service) DecryptLNUrlPayMessage ¶
func (*Service) EnableAccount ¶
EnableAccount controls whether the account will be enabled or disabled. When disbled, no attempt will be made to open a channel with breez node.
func (*Service) FinishLNURLAuth ¶
FinishLNURLAuth logs in using lnurl auth protocol
func (*Service) FinishLNURLPay ¶
func (a *Service) FinishLNURLPay(params *data.LNURLPayResponse1) (*data.LNUrlPayInfo, error)
func (*Service) FinishLNURLWithdraw ¶
func (*Service) GetAccountInfo ¶
GetAccountInfo is responsible for retrieving some general account details such as balance, status, etc...
func (*Service) GetAccountLimits ¶
GetAccountLimits returns the account limits.
func (*Service) GetDefaultSatPerByteFee ¶
GetDefaultSatPerByteFee returns the default sat per byte fee for on chain transactions
func (*Service) GetGlobalMaxReceiveLimit ¶
GetGlobalMaxReceiveLimit returns the account global max receive limit.
func (*Service) GetKeyPair ¶
func (*Service) GetMaxAmount ¶
func (*Service) GetPaymentRequestHash ¶
func (*Service) GetPayments ¶
func (a *Service) GetPayments() (*data.PaymentsList, error)
GetPayments is responsible for retrieving the payment were made in this account
func (*Service) GetRelatedInvoice ¶
GetRelatedInvoice is used by the payee to fetch the related invoice of its sent payment request so he can see if it is settled.
func (*Service) HandleLNURL ¶
func (a *Service) HandleLNURL(rawString string) (result *data.LNUrlResponse, err error)
func (*Service) LSPActivity ¶
func (*Service) OpenDirectLnurlChannel ¶
OpenDirectLnurlChannel is responsible for creating a new channel using lnURL
data
func (*Service) OpenLSPChannel ¶
OpenLSPChannel is responsible for creating a new channel with the LSP
func (*Service) OpenLnurlChannel ¶
OpenLnurlChannel is responsible for creating a new channel using a lnURL
func (*Service) PublishTransaction ¶
func (*Service) RegisterChannelOpenedNotification ¶
RegisterChannelOpenedNotification register in breez server for notification regarding the confirmation of an existing pending channel. If there is not channels and no pending channels then this function waits for for a channel to be opened.
func (*Service) RegisterPeriodicSync ¶
RegisterPeriodicSync registeres this token for periodic sync notifications.
func (*Service) RegisterReceivePaymentReadyNotification ¶
RegisterReceivePaymentReadyNotification register in breez server for notification regarding the confirmation of an existing pending channel. If there is not channels and no pending channels then this function waits for for a channel to be opened.
func (*Service) SendPaymentFailureBugReport ¶
SendPaymentFailureBugReport is used for investigating payment failures. It should be used if the user agrees to send his payment details and the response of QueryRoutes running in his node. The information is sent to the "bugreporturl" service.
func (*Service) SendPaymentForRequest ¶
func (a *Service) SendPaymentForRequest(paymentRequest string, amountSatoshi int64, fee int64) (string, error)
SendPaymentForRequest send the payment according to the details specified in the bolt 11 payment request. If the payment was failed an error is returned
func (*Service) SendPaymentForRequestV2 ¶
func (a *Service) SendPaymentForRequestV2(paymentRequest string, amountSatoshi int64, lastHopPubkey []byte, fee int64) (string, error)
SendPaymentForRequestV2 send the payment according to the details specified in the bolt 11 payment request. If the payment was failed an error is returned
func (*Service) SendSpontaneousPayment ¶
func (a *Service) SendSpontaneousPayment(destNode string, description string, amount int64, feeLimitMSat int64, groupKey, groupName string, tlv map[int64]string) (string, error)
SendSpontaneousPayment send a payment without a payment request.
func (*Service) SendWalletCoins ¶
SendWalletCoins executes a request to send wallet coins to a particular address.
func (*Service) SweepAllCoinsTransactions ¶
func (a *Service) SweepAllCoinsTransactions(address string) (*data.SweepAllCoinsTransactions, error)
SweepAllCoinsTransactions executes a request to send wallet coins to a particular address.
func (*Service) ValidateAddress ¶
ValidateAddress validates a bitcoin address based on the network type