bindings

package
v0.0.0-...-a00ca78 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: GPL-3.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorForceRescan    = fmt.Errorf("Force rescan")
	ErrorForceBootstrap = fmt.Errorf("Force bootstrap")
)

Functions

func AddFundsInit

func AddFundsInit(initRequest []byte) ([]byte, error)

AddFundsInit is part of the binding inteface which is delegated to breez.AddFundsInit

func AddInvoice

func AddInvoice(invoice []byte) ([]byte, error)

AddInvoice is part of the binding inteface which is delegated to breez.AddInvoice

func AvailableSnapshots

func AvailableSnapshots() (string, error)

AvailableSnapshots is part of the binding inteface which is delegated to breez.AvailableSnapshots

func BackupFiles

func BackupFiles() (string, error)

func CheckLSPClosedChannelMismatch

func CheckLSPClosedChannelMismatch(request []byte) ([]byte, error)

func CheckVersion

func CheckVersion() error

func CloseChannels

func CloseChannels(address string) ([]byte, error)

func ConnectAccount

func ConnectAccount() error

ConnectAccount is part of the binding inteface which is delegated to breez.ConnectAccount

func ConnectDirectToLnurl

func ConnectDirectToLnurl(channel []byte) error

func ConnectToLSP

func ConnectToLSP(id string) error

func ConnectToLSPPeer

func ConnectToLSPPeer(id string) error

func ConnectToLnurl

func ConnectToLnurl(lnurl string) error

func CreateRatchetSession

func CreateRatchetSession(request []byte) ([]byte, error)

CreateRatchetSession is part of the binding inteface which is delegated to breez.CreateRatchetSession

func DaemonReady

func DaemonReady() bool

DaemonReady returns the status of the daemon

func DecodePaymentRequest

func DecodePaymentRequest(paymentRequest string) ([]byte, error)

DecodePaymentRequest is part of the binding inteface which is delegated to breez.DecodePaymentRequest

func DeleteGraph

func DeleteGraph() error

func DownloadBackup

func DownloadBackup(nodeID string) ([]byte, error)

DownloadBackup is part of the binding inteface which is delegated to breez.DownloadBackup

func EnableAccount

func EnableAccount(enabled bool) error

EnableAccount is part of the binding inteface which is delegated to breez.EnableAccount

func FetchLnurl

func FetchLnurl(lnurl string) ([]byte, error)

func FetchReverseSwap

func FetchReverseSwap(hash string) ([]byte, error)

func FinishLNURLAuth

func FinishLNURLAuth(request []byte) (string, error)

func FinishLNURLPay

func FinishLNURLPay(request []byte) (result []byte, err error)

func GetAccountInfo

func GetAccountInfo() ([]byte, error)

GetAccountInfo is part of the binding inteface which is delegated to breez.GetAccountInfo

func GetDefaultOnChainFeeRate

func GetDefaultOnChainFeeRate() (int64, error)

GetDefaultOnChainFeeRate is part of the binding inteface which is delegated to breez.GetDefaultOnChainFeeRate

func GetFundStatus

func GetFundStatus(notificationToken string) ([]byte, error)

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 GetNostrKeyPair() (string, error)

func GetPaymentRequestHash

func GetPaymentRequestHash(paymentRequest string) (string, error)

GetPaymentRequestHash is part of the binding inteface which is delegated to breez.GetPaymentRequestHash

func GetPayments

func GetPayments() ([]byte, error)

GetPayments is part of the binding inteface which is delegated to breez.GetPayments

func GetPeers

func GetPeers() ([]byte, error)

func GetRelatedInvoice

func GetRelatedInvoice(paymentRequest string) ([]byte, error)

GetRelatedInvoice is part of the binding inteface which is delegated to breez.GetRelatedInvoice

func GetTorActive

func GetTorActive() bool

func GetTxSpentURL

func GetTxSpentURL() ([]byte, error)

func GraphURL

func GraphURL() (string, error)

func HasClosedChannels

func HasClosedChannels() (bool, error)

func Init

func Init(tempDir string, workingDir string, services AppServices) (err error)

Init initialize lightning client

func LSPActivity

func LSPActivity() ([]byte, error)

func LSPList

func LSPList() ([]byte, error)

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 Log

func Log(msg string, lvl string)

Log is a function that uses the breez logger

func MaxReverseSwapAmount

func MaxReverseSwapAmount() (int64, error)

func NewReverseSwap

func NewReverseSwap(request []byte) (string, error)

func OnResume

func OnResume()

OnResume just calls the breez.OnResume

func PayReverseSwap

func PayReverseSwap(request []byte) error

func PopulateChannelPolicy

func PopulateChannelPolicy()

func PublishTransaction

func PublishTransaction(tx []byte) error

func RatchetDecrypt

func RatchetDecrypt(request []byte) (string, error)

RatchetDecrypt is part of the binding inteface which is delegated to breez.RatchetDecrypt

func RatchetEncrypt

func RatchetEncrypt(request []byte) (string, error)

RatchetEncrypt is part of the binding inteface which is delegated to breez.RatchetEncrypt

func RatchetSessionInfo

func RatchetSessionInfo(sessionID string) ([]byte, error)

RatchetSessionInfo is part of the binding inteface which is delegated to breez.RatchetSessionInfo

func RatchetSessionSetInfo

func RatchetSessionSetInfo(request []byte) error

RatchetSessionSetInfo is part of the binding inteface which is delegated to breez.RatchetSessionSetInfo

func Rate

func Rate() ([]byte, error)

func ReceiverNode

func ReceiverNode() (string, error)

func Refund

func Refund(refundRequest []byte) (string, error)

Refund transfers the funds in address to the user destination address

func RefundFees

func RefundFees(refundRequest []byte) (int64, error)

RefundFees transfers the funds in address to the user destination address

func RegisterChannelOpenedNotification

func RegisterChannelOpenedNotification(token string) error

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

func RegisterPeriodicSync(token string) error

RegisterPeriodicSync is part of the binding inteface which is delegated to breez.RegisterPeriodicSync

func RegisterReceivePaymentReadyNotification

func RegisterReceivePaymentReadyNotification(token string) error

RegisterReceivePaymentReadyNotification is part of the binding inteface which is delegated to breez.RegisterReceivePaymentReadyNotification

func RemoveFund

func RemoveFund(removeFundRequest []byte) ([]byte, error)

RemoveFund is part of the binding inteface which is delegated to breez.RemoveFund

func RequestAppDataBackup

func RequestAppDataBackup()

func RequestBackup

func RequestBackup()

RequestBackup triggers breez RequestBackup

func ResetClosedChannelChainInfo

func ResetClosedChannelChainInfo(request []byte) ([]byte, error)

func ResetUnconfirmedReverseSwapClaimTransaction

func ResetUnconfirmedReverseSwapClaimTransaction() error

func RestartDaemon

func RestartDaemon() error

RestartDaemon attempts to restart the daemon service.

func RestoreBackup

func RestoreBackup(nodeID string, encryptionKey []byte) (err error)

RestoreBackup is part of the binding inteface which is delegated to breez.RestoreBackup

func ReverseSwapClaimFeeEstimates

func ReverseSwapClaimFeeEstimates(claimAddress string) ([]byte, error)

func ReverseSwapInfo

func ReverseSwapInfo() ([]byte, error)

func ReverseSwapPayments

func ReverseSwapPayments() ([]byte, error)

func SendCommand

func SendCommand(command string) (string, error)

SendCommand is part of the binding inteface which is delegated to breez.SendPaymentForRequest

func SendPaymentFailureBugReport

func SendPaymentFailureBugReport(report string) error

SendPaymentFailureBugReport is part of the binding inteface which is delegated to breez.SendPaymentFailureBugReport

func SendPaymentForRequest

func SendPaymentForRequest(payInvoiceRequest []byte) ([]byte, error)

SendPaymentForRequest is part of the binding inteface which is delegated to breez.SendPaymentForRequest

func SendSpontaneousPayment

func SendSpontaneousPayment(spontaneousPayment []byte) ([]byte, error)

SendSpontaneousPayment is part of the binding inteface which is delegated to breez.SendSpontaneousPayment

func SendWalletCoins

func SendWalletCoins(sendCoinsRequest []byte) (string, error)

SendWalletCoins is part of the binding inteface which is delegated to breez.SendWalletCoins

func SetBackupEncryptionKey

func SetBackupEncryptionKey(key []byte, encryptionType string) error

SetBackupEncryptionKey sets the security key to the backup manager so it can be used in encrypting backup files.

func SetBackupProvider

func SetBackupProvider(providerName, authData string) error

SetBackupProvider sets a new backup provider backend.

func SetBackupTorConfig

func SetBackupTorConfig(torConfig []byte) error

func SetNonBlockingUnconfirmedSwaps

func SetNonBlockingUnconfirmedSwaps() error

func SetPeers

func SetPeers(request []byte) error

func SetReverseSwapClaimFee

func SetReverseSwapClaimFee(request []byte) error

func SetTorActive

func SetTorActive(enable bool) (err error)

func SetTxSpentURL

func SetTxSpentURL(request []byte) error

func Start

func Start(torConfig []byte) error

Start the lightning client

func Stop

func Stop()

Stop the lightning client

func SweepAllCoinsTransactions

func SweepAllCoinsTransactions(address string) ([]byte, error)

func SyncGraphFromFile

func SyncGraphFromFile(sourceFilePath string) error

func TestBackupAuth

func TestBackupAuth(provider, authData string) error

func TestPeer

func TestPeer(peer string) error

func TestTxSpentURL

func TestTxSpentURL(txSpentURL string) error

func UnconfirmedReverseSwapClaimTransaction

func UnconfirmedReverseSwapClaimTransaction() (string, error)

func ValidateAddress

func ValidateAddress(address string) error

ValidateAddress is part of the binding inteface which is delegated to breez.ValidateAddress

func WithdrawLnurl

func WithdrawLnurl(bolt11 string) error

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

type BackupService interface {
	Backup(files string, nodeID, backupID string) error
}

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

type ChannelsWatcherJobController interface {
	Run() (bool, error)
	Stop()
}

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 Logger

type Logger interface {
	Log(msg string, lvl string)
}

Logger is an interface that is used to log to the central log file.

func GetLogger

func GetLogger(appDir string) (Logger, error)

GetLogger creates a logger that logs to the same breez central log file

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 (r *RPC) GetLSPList(ctx context.Context, in *data.LSPListRequest) (
	*data.LSPList, error)

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)

func (*RPC) Start

func (r *RPC) Start()

Jump to

Keyboard shortcuts

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