Documentation ¶
Index ¶
- Variables
- func AddFundsInit(initRequest []byte) ([]byte, error)
- func AddInvoice(invoice []byte) ([]byte, error)
- func AvailableSnapshots() (string, error)
- func BackupFiles() (string, error)
- func CheckLSPClosedChannelMismatch(request []byte) ([]byte, error)
- func CheckVersion() error
- func CloseChannels(address string) ([]byte, error)
- func ConnectAccount() error
- func ConnectDirectToLnurl(channel []byte) error
- func ConnectToLSP(id string) error
- func ConnectToLSPPeer(id string) error
- func ConnectToLnurl(lnurl string) error
- func CreateRatchetSession(request []byte) ([]byte, error)
- func DaemonReady() bool
- func DecodePaymentRequest(paymentRequest string) ([]byte, error)
- func DeleteGraph() error
- func DownloadBackup(nodeID string) ([]byte, error)
- func EnableAccount(enabled bool) error
- func FetchLnurl(lnurl string) ([]byte, error)
- func FetchReverseSwap(hash string) ([]byte, error)
- func FinishLNURLAuth(request []byte) (string, error)
- func FinishLNURLPay(request []byte) (result []byte, err error)
- func GetAccountInfo() ([]byte, error)
- func GetDefaultOnChainFeeRate() (int64, error)
- func GetFundStatus(notificationToken string) ([]byte, error)
- func GetLogPath() string
- func GetNostrKeyPair() (string, error)
- func GetPaymentRequestHash(paymentRequest string) (string, error)
- func GetPayments() ([]byte, error)
- func GetPeers() ([]byte, error)
- func GetRelatedInvoice(paymentRequest string) ([]byte, error)
- func GetTorActive() bool
- func GetTxSpentURL() ([]byte, error)
- func GraphURL() (string, error)
- func HasClosedChannels() (bool, error)
- func Init(tempDir string, workingDir string, services AppServices) (err error)
- func LSPActivity() ([]byte, error)
- func LSPList() ([]byte, error)
- func LastSyncedHeaderTimestamp() int64
- func LatestBackupTime() int64
- func Log(msg string, lvl string)
- func MaxReverseSwapAmount() (int64, error)
- func NewReverseSwap(request []byte) (string, error)
- func OnResume()
- func PayReverseSwap(request []byte) error
- func PopulateChannelPolicy()
- func PublishTransaction(tx []byte) error
- func RatchetDecrypt(request []byte) (string, error)
- func RatchetEncrypt(request []byte) (string, error)
- func RatchetSessionInfo(sessionID string) ([]byte, error)
- func RatchetSessionSetInfo(request []byte) error
- func Rate() ([]byte, error)
- func ReceiverNode() (string, error)
- func Refund(refundRequest []byte) (string, error)
- func RefundFees(refundRequest []byte) (int64, error)
- func RegisterChannelOpenedNotification(token string) error
- func RegisterNativeBackupProvider(name string, provider NativeBackupProvider)
- func RegisterPeriodicSync(token string) error
- func RegisterReceivePaymentReadyNotification(token string) error
- func RemoveFund(removeFundRequest []byte) ([]byte, error)
- func RequestAppDataBackup()
- func RequestBackup()
- func ResetClosedChannelChainInfo(request []byte) ([]byte, error)
- func ResetUnconfirmedReverseSwapClaimTransaction() error
- func RestartDaemon() error
- func RestoreBackup(nodeID string, encryptionKey []byte) (err error)
- func ReverseSwapClaimFeeEstimates(claimAddress string) ([]byte, error)
- func ReverseSwapInfo() ([]byte, error)
- func ReverseSwapPayments() ([]byte, error)
- func SendCommand(command string) (string, error)
- func SendPaymentFailureBugReport(report string) error
- func SendPaymentForRequest(payInvoiceRequest []byte) ([]byte, error)
- func SendSpontaneousPayment(spontaneousPayment []byte) ([]byte, error)
- func SendWalletCoins(sendCoinsRequest []byte) (string, error)
- func SetBackupEncryptionKey(key []byte, encryptionType string) error
- func SetBackupProvider(providerName, authData string) error
- func SetBackupTorConfig(torConfig []byte) error
- func SetNonBlockingUnconfirmedSwaps() error
- func SetPeers(request []byte) error
- func SetReverseSwapClaimFee(request []byte) error
- func SetTorActive(enable bool) (err error)
- func SetTxSpentURL(request []byte) error
- func Start(torConfig []byte) error
- func Stop()
- func SweepAllCoinsTransactions(address string) ([]byte, error)
- func SyncGraphFromFile(sourceFilePath string) error
- func TestBackupAuth(provider, authData string) error
- func TestPeer(peer string) error
- func TestTxSpentURL(txSpentURL string) error
- func UnconfirmedReverseSwapClaimTransaction() (string, error)
- func ValidateAddress(address string) error
- func WithdrawLnurl(bolt11 string) error
- type AppServices
- type BackupService
- type BreezLogger
- type ChannelsWatcherJobController
- type JobController
- type Logger
- type NativeBackupProvider
- type NativeBackupProviderBridge
- func (b *NativeBackupProviderBridge) AvailableSnapshots() ([]backup.SnapshotInfo, error)
- func (b *NativeBackupProviderBridge) DownloadBackupFiles(nodeID, backupID string) ([]string, error)
- func (b *NativeBackupProviderBridge) GetProviderTimestamp(nodeID string) (time.Time, error)
- func (b *NativeBackupProviderBridge) SetTor(torConfig *tor.TorConfig)
- func (b *NativeBackupProviderBridge) TestAuth() error
- func (b *NativeBackupProviderBridge) UploadBackupFiles(file string, nodeID string, encryptionType string, timestamp time.Time) (string, error)
- type RPC
- func (r *RPC) AddFundInit(ctx context.Context, in *data.AddFundInitRequest) (*data.AddFundInitReply, error)
- func (r *RPC) AddInvoice(ctx context.Context, in *data.AddInvoiceRequest) (*data.AddInvoiceReply, error)
- func (r *RPC) CloseChannels(ctx context.Context, in *data.CloseChannelsRequest) (*data.CloseChannelsReply, error)
- func (r *RPC) ConnectToLSP(ctx context.Context, in *data.ConnectLSPRequest) (*data.ConnectLSPReply, error)
- func (r *RPC) GetFundStatus(ctx context.Context, in *data.FundStatusRequest) (*data.FundStatusReply, error)
- func (r *RPC) GetLSPList(ctx context.Context, in *data.LSPListRequest) (*data.LSPList, error)
- func (r *RPC) ListPayments(ctx context.Context, in *data.ListPaymentsRequest) (*data.PaymentsList, error)
- func (r *RPC) PayInvoice(ctx context.Context, in *data.PayInvoiceRequest) (*data.PaymentResponse, error)
- func (r *RPC) RestartDaemon(ctx context.Context, in *data.RestartDaemonRequest) (*data.RestartDaemonReply, error)
- func (r *RPC) Start()
Constants ¶
This section is empty.
Variables ¶
var ( ErrorForceRescan = fmt.Errorf("Force rescan") ErrorForceBootstrap = fmt.Errorf("Force bootstrap") )
Functions ¶
func AddFundsInit ¶
AddFundsInit is part of the binding inteface which is delegated to breez.AddFundsInit
func AddInvoice ¶
AddInvoice is part of the binding inteface which is delegated to breez.AddInvoice
func AvailableSnapshots ¶
AvailableSnapshots is part of the binding inteface which is delegated to breez.AvailableSnapshots
func BackupFiles ¶
func CheckVersion ¶
func CheckVersion() error
func CloseChannels ¶
func ConnectAccount ¶
func ConnectAccount() error
ConnectAccount is part of the binding inteface which is delegated to breez.ConnectAccount
func ConnectDirectToLnurl ¶
func ConnectToLSP ¶
func ConnectToLSPPeer ¶
func ConnectToLnurl ¶
func CreateRatchetSession ¶
CreateRatchetSession is part of the binding inteface which is delegated to breez.CreateRatchetSession
func DecodePaymentRequest ¶
DecodePaymentRequest is part of the binding inteface which is delegated to breez.DecodePaymentRequest
func DeleteGraph ¶
func DeleteGraph() error
func DownloadBackup ¶
DownloadBackup is part of the binding inteface which is delegated to breez.DownloadBackup
func EnableAccount ¶
EnableAccount is part of the binding inteface which is delegated to breez.EnableAccount
func FetchLnurl ¶
func FetchReverseSwap ¶
func FinishLNURLAuth ¶
func FinishLNURLPay ¶
func GetAccountInfo ¶
GetAccountInfo is part of the binding inteface which is delegated to breez.GetAccountInfo
func GetDefaultOnChainFeeRate ¶
GetDefaultOnChainFeeRate is part of the binding inteface which is delegated to breez.GetDefaultOnChainFeeRate
func GetFundStatus ¶
GetFundStatus is part of the binding inteface which is delegated to breez.GetFundStatus
func GetLogPath ¶
func GetLogPath() string
GetLogPath is part of the binding inteface which is delegated to breez.GetLogPath
func GetNostrKeyPair ¶
func GetPaymentRequestHash ¶
GetPaymentRequestHash is part of the binding inteface which is delegated to breez.GetPaymentRequestHash
func GetPayments ¶
GetPayments is part of the binding inteface which is delegated to breez.GetPayments
func GetRelatedInvoice ¶
GetRelatedInvoice is part of the binding inteface which is delegated to breez.GetRelatedInvoice
func GetTorActive ¶
func GetTorActive() bool
func GetTxSpentURL ¶
func HasClosedChannels ¶
func Init ¶
func Init(tempDir string, workingDir string, services AppServices) (err error)
Init initialize lightning client
func LSPActivity ¶
func LastSyncedHeaderTimestamp ¶
func LastSyncedHeaderTimestamp() int64
LastSyncedHeaderTimestamp returns the last header the node is synced to.
func LatestBackupTime ¶
func LatestBackupTime() int64
LatestBackupTime return the UnixMilli of the latest backup from our local file that keeps track of the latest backup's snapshot.
func MaxReverseSwapAmount ¶
func NewReverseSwap ¶
func PayReverseSwap ¶
func PopulateChannelPolicy ¶
func PopulateChannelPolicy()
func PublishTransaction ¶
func RatchetDecrypt ¶
RatchetDecrypt is part of the binding inteface which is delegated to breez.RatchetDecrypt
func RatchetEncrypt ¶
RatchetEncrypt is part of the binding inteface which is delegated to breez.RatchetEncrypt
func RatchetSessionInfo ¶
RatchetSessionInfo is part of the binding inteface which is delegated to breez.RatchetSessionInfo
func RatchetSessionSetInfo ¶
RatchetSessionSetInfo is part of the binding inteface which is delegated to breez.RatchetSessionSetInfo
func ReceiverNode ¶
func RefundFees ¶
RefundFees transfers the funds in address to the user destination address
func RegisterChannelOpenedNotification ¶
RegisterChannelOpenedNotification is part of the binding inteface which is delegated to breez.RegisterChannelOpenedNotification
func RegisterNativeBackupProvider ¶
func RegisterNativeBackupProvider(name string, provider NativeBackupProvider)
RegisterNativeBackupProvider registered a native backup provider
func RegisterPeriodicSync ¶
RegisterPeriodicSync is part of the binding inteface which is delegated to breez.RegisterPeriodicSync
func RegisterReceivePaymentReadyNotification ¶
RegisterReceivePaymentReadyNotification is part of the binding inteface which is delegated to breez.RegisterReceivePaymentReadyNotification
func RemoveFund ¶
RemoveFund is part of the binding inteface which is delegated to breez.RemoveFund
func RequestAppDataBackup ¶
func RequestAppDataBackup()
func ResetUnconfirmedReverseSwapClaimTransaction ¶
func ResetUnconfirmedReverseSwapClaimTransaction() error
func RestartDaemon ¶
func RestartDaemon() error
RestartDaemon attempts to restart the daemon service.
func RestoreBackup ¶
RestoreBackup is part of the binding inteface which is delegated to breez.RestoreBackup
func ReverseSwapInfo ¶
func ReverseSwapPayments ¶
func SendCommand ¶
SendCommand is part of the binding inteface which is delegated to breez.SendPaymentForRequest
func SendPaymentFailureBugReport ¶
SendPaymentFailureBugReport is part of the binding inteface which is delegated to breez.SendPaymentFailureBugReport
func SendPaymentForRequest ¶
SendPaymentForRequest is part of the binding inteface which is delegated to breez.SendPaymentForRequest
func SendSpontaneousPayment ¶
SendSpontaneousPayment is part of the binding inteface which is delegated to breez.SendSpontaneousPayment
func SendWalletCoins ¶
SendWalletCoins is part of the binding inteface which is delegated to breez.SendWalletCoins
func SetBackupEncryptionKey ¶
SetBackupEncryptionKey sets the security key to the backup manager so it can be used in encrypting backup files.
func SetBackupProvider ¶
SetBackupProvider sets a new backup provider backend.
func SetBackupTorConfig ¶
func SetNonBlockingUnconfirmedSwaps ¶
func SetNonBlockingUnconfirmedSwaps() error
func SetReverseSwapClaimFee ¶
func SetTorActive ¶
func SetTxSpentURL ¶
func SyncGraphFromFile ¶
func TestBackupAuth ¶
func TestTxSpentURL ¶
func ValidateAddress ¶
ValidateAddress is part of the binding inteface which is delegated to breez.ValidateAddress
func WithdrawLnurl ¶
Types ¶
type AppServices ¶
type AppServices interface { Notify(notificationEvent []byte) BackupProviderName() string BackupProviderSignIn() (string, error) }
AppServices defined the interface needed in Breez library in order to functional right.
type BackupService ¶
BackupService is an service to this libary for backup execution.
type BreezLogger ¶
type BreezLogger struct {
// contains filtered or unexported fields
}
BreezLogger is the implementation of Logger
func (*BreezLogger) Log ¶
func (l *BreezLogger) Log(msg string, lvl string)
Log writs to the centeral log file
type ChannelsWatcherJobController ¶
ChannelsWatcherJobController is the interface to return when scheuling the channels watcher job to allow the caller to cancel at any time
func NewSyncJob ¶
func NewSyncJob(workingDir string) (ChannelsWatcherJobController, error)
NewSyncJob starts breez only to reach synchronized state. The daemon closes itself automatically when reaching this state.
type JobController ¶
type JobController interface { Run() error Stop() }
JobController is the interface to return when scheuling a job to allow the caller to cancel at any time
func NewClosedChannelsJob ¶
func NewClosedChannelsJob(workingDir string) (JobController, error)
NewClosedChannelsJob starts a job to download the list of closed channels. The daemon closes itself automatically when reaching this state.
type NativeBackupProvider ¶
type NativeBackupProvider interface { UploadBackupFiles(file string, nodeID string, encryptionType string, timestamp string) (string, error) AvailableSnapshots() (string, error) DownloadBackupFiles(nodeID, backupID string) (string, error) GetProviderTimestamp(nodeID string) (string, error) }
NativeBackupProvider is interface that serves as backup provider and is intended to be implemented by the native platform and injected to breez library. It is usefull when it is more nature to implement the provider in the native environment rather than in go API.
type NativeBackupProviderBridge ¶
type NativeBackupProviderBridge struct {
// contains filtered or unexported fields
}
NativeBackupProviderBridge is a bridge for using a native implemented provider in the backup manager.
func (*NativeBackupProviderBridge) AvailableSnapshots ¶
func (b *NativeBackupProviderBridge) AvailableSnapshots() ([]backup.SnapshotInfo, error)
AvailableSnapshots is called when querying for all available nodes backups.
func (*NativeBackupProviderBridge) DownloadBackupFiles ¶
func (b *NativeBackupProviderBridge) DownloadBackupFiles(nodeID, backupID string) ([]string, error)
DownloadBackupFiles is called when restring from a backup snapshot.
func (*NativeBackupProviderBridge) GetProviderTimestamp ¶
func (b *NativeBackupProviderBridge) GetProviderTimestamp(nodeID string) (time.Time, error)
GetProviderTimestamp is called in order to get a more accurate timestamp from the cloud.
func (*NativeBackupProviderBridge) SetTor ¶
func (b *NativeBackupProviderBridge) SetTor(torConfig *tor.TorConfig)
func (*NativeBackupProviderBridge) TestAuth ¶
func (b *NativeBackupProviderBridge) TestAuth() error
func (*NativeBackupProviderBridge) UploadBackupFiles ¶
func (b *NativeBackupProviderBridge) UploadBackupFiles(file string, nodeID string, encryptionType string, timestamp time.Time) (string, error)
UploadBackupFiles is called when files needs to be uploaded as part of the backup
type RPC ¶
type RPC struct {
data.UnimplementedBreezAPIServer
}
func (*RPC) AddFundInit ¶
func (r *RPC) AddFundInit(ctx context.Context, in *data.AddFundInitRequest) ( *data.AddFundInitReply, error)
func (*RPC) AddInvoice ¶
func (r *RPC) AddInvoice(ctx context.Context, in *data.AddInvoiceRequest) ( *data.AddInvoiceReply, error)
func (*RPC) CloseChannels ¶
func (r *RPC) CloseChannels(ctx context.Context, in *data.CloseChannelsRequest) ( *data.CloseChannelsReply, error)
func (*RPC) ConnectToLSP ¶
func (r *RPC) ConnectToLSP(ctx context.Context, in *data.ConnectLSPRequest) ( *data.ConnectLSPReply, error)
func (*RPC) GetFundStatus ¶
func (r *RPC) GetFundStatus(ctx context.Context, in *data.FundStatusRequest) ( *data.FundStatusReply, error)
func (*RPC) GetLSPList ¶
func (*RPC) ListPayments ¶
func (r *RPC) ListPayments(ctx context.Context, in *data.ListPaymentsRequest) ( *data.PaymentsList, error)
func (*RPC) PayInvoice ¶
func (r *RPC) PayInvoice(ctx context.Context, in *data.PayInvoiceRequest) ( *data.PaymentResponse, error)
func (*RPC) RestartDaemon ¶
func (r *RPC) RestartDaemon(ctx context.Context, in *data.RestartDaemonRequest) ( *data.RestartDaemonReply, error)