Documentation ¶
Index ¶
- Constants
- type ChannelCloseStatus
- type DB
- func (db *DB) AccountEnabled() (bool, error)
- func (db *DB) AddAccountPayment(accPayment *PaymentInfo, receivedIndex uint64, sentTime uint64) (bool, error)
- func (db *DB) AddChannelClosedPayment(accPayment *PaymentInfo) error
- func (db *DB) AddRedeemablePaymentHash(hash string) error
- func (db *DB) AddZeroConfHash(hash []byte, payreq []byte) error
- func (db *DB) BackupDb(dir string) (string, error)
- func (db *DB) DeleteDB() error
- func (db *DB) EnableAccount(enabled bool) error
- func (db *DB) FetchAccount() ([]byte, error)
- func (db *DB) FetchAllAccountPayments() ([]*PaymentInfo, error)
- func (db *DB) FetchAllLNUrlPayInfos() ([]*data.LNUrlPayInfo, error)
- func (db *DB) FetchAllSwapAddresses() ([]*SwapAddressInfo, error)
- func (db *DB) FetchLNURLAuthKey(createNew func() ([]byte, error)) ([]byte, error)
- func (db *DB) FetchLNUrlPayInfo(paymentHash string) (*data.LNUrlPayInfo, error)
- func (db *DB) FetchLastSyncedHeaderTimestamp() (int64, error)
- func (db *DB) FetchMismatchedChannels() (*MismatchedChannels, error)
- func (db *DB) FetchNostrPrivKey(createNew func() string) (string, error)
- func (db *DB) FetchPaymentGroup(payReqHash string) ([]byte, []byte, error)
- func (db *DB) FetchPaymentRequest(payReqHash string) ([]byte, error)
- func (db *DB) FetchPaymentsSyncInfo() (lastTime int64, lastSetteledIndex uint64)
- func (db *DB) FetchRedeemablePaymentHashes() ([]string, error)
- func (db *DB) FetchReverseSwap(hash string) (*data.ReverseSwap, error)
- func (db *DB) FetchSwapAddresses(filterFunc func(addr *SwapAddressInfo) bool) ([]*SwapAddressInfo, error)
- func (db *DB) FetchTipMessage(payReqHash string) ([]byte, error)
- func (db *DB) FetchUnconfirmedClaimTransaction() (*chainrpc.ConfRequest, error)
- func (db *DB) FetchUnspendLockupInformation() (*data.UnspendLockupInformation, error)
- func (db *DB) FetchZeroConfHashes() ([][]byte, error)
- func (db *DB) FetchZeroConfInvoice(hash []byte) ([]byte, error)
- func (db *DB) GetPeers(defaults []string) (peers []string, isDefault bool, err error)
- func (db *DB) GetTorActive() (result bool, err error)
- func (db *DB) GetTxSpentURL(defaultURL string) (txSpentURL string, isDefault bool, err error)
- func (db *DB) IsInvoiceHashPaid(payReqHash string) (bool, error)
- func (db *DB) MigrateAllLNUrlPayMetadata() error
- func (db *DB) RemoveChannelMismatch() error
- func (db *DB) RemoveZeroConfHash(hash []byte) error
- func (db *DB) SaveAccount(account []byte) error
- func (db *DB) SaveLNUrlPayInfo(info *data.LNUrlPayInfo) error
- func (db *DB) SavePaymentGroup(payReqHash string, groupKey, groupName []byte) error
- func (db *DB) SavePaymentRequest(payReqHash string, payReq []byte) error
- func (db *DB) SaveReverseSwap(rs *data.ReverseSwap) (string, error)
- func (db *DB) SaveSwapAddressInfo(address *SwapAddressInfo) error
- func (db *DB) SaveTipMessage(payReqHash string, message []byte) error
- func (db *DB) SaveUnconfirmedClaimTransaction(confRequest *chainrpc.ConfRequest) error
- func (db *DB) SaveUnspendLockupInformation(unspendLockupTransaction *data.UnspendLockupInformation) error
- func (db *DB) SetLastSyncedHeaderTimestamp(ts int64) error
- func (db *DB) SetMismatchedChannels(mismatched *MismatchedChannels) error
- func (db *DB) SetPeers(peers []string) error
- func (db *DB) SetTorActive(active bool) error
- func (db *DB) SetTxSpentURL(txSpentURL string) error
- func (db *DB) UpdateRedeemTxForPayment(hash string, txID string) error
- func (db *DB) UpdateSwapAddress(address string, updateFunc func(*SwapAddressInfo) error) (bool, error)
- func (db *DB) UpdateSwapAddressByPaymentHash(pHash []byte, updateFunc func(*SwapAddressInfo) error) (bool, error)
- type MismatchedChannel
- type MismatchedChannels
- type PaymentInfo
- type PaymentType
- type SwapAddressInfo
Constants ¶
const ( //SentPayment is type for sent payments SentPayment = PaymentType(0) //ReceivedPayment is type for received payments ReceivedPayment = PaymentType(1) //DepositPayment is type for payment got from add funds DepositPayment = PaymentType(2) //WithdrawalPayment is type for payment got from remove funds WithdrawalPayment = PaymentType(3) //ClosedChannelPayment is type for payment got from a closed channel ClosedChannelPayment = PaymentType(4) WaitingClose = ChannelCloseStatus(0) PendingClose = ChannelCloseStatus(1) ConfirmedClose = ChannelCloseStatus(2) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelCloseStatus ¶
type ChannelCloseStatus byte
type DB ¶
DB is the structure for breez database
func (*DB) AccountEnabled ¶
AccountEnabled returns the account state
func (*DB) AddAccountPayment ¶
func (db *DB) AddAccountPayment(accPayment *PaymentInfo, receivedIndex uint64, sentTime uint64) (bool, error)
AddAccountPayment adds a payment to the database
func (*DB) AddChannelClosedPayment ¶
func (db *DB) AddChannelClosedPayment(accPayment *PaymentInfo) error
AddChannelClosedPayment adds a payment that reflects channel close to the db.
func (*DB) AddRedeemablePaymentHash ¶
func (*DB) AddZeroConfHash ¶
AddZeroConfHash saves a zero conf hash to track.
func (*DB) EnableAccount ¶
EnableAccount sets the account state to either enabled or disabled
func (*DB) FetchAccount ¶
FetchAccount fetches the cached account info from the database
func (*DB) FetchAllAccountPayments ¶
func (db *DB) FetchAllAccountPayments() ([]*PaymentInfo, error)
FetchAllAccountPayments fetches all payments in the database sorted by date
func (*DB) FetchAllLNUrlPayInfos ¶
func (db *DB) FetchAllLNUrlPayInfos() ([]*data.LNUrlPayInfo, error)
func (*DB) FetchAllSwapAddresses ¶
func (db *DB) FetchAllSwapAddresses() ([]*SwapAddressInfo, error)
Swap addresses
func (*DB) FetchLNURLAuthKey ¶
FetchLNURLAuthKey fetches the bip32 master key for lnurl auth.
func (*DB) FetchLNUrlPayInfo ¶
func (db *DB) FetchLNUrlPayInfo(paymentHash string) (*data.LNUrlPayInfo, error)
func (*DB) FetchLastSyncedHeaderTimestamp ¶
FetchLastSyncedHeaderTimestamp the last known header timestamp that the node is synced to.
func (*DB) FetchMismatchedChannels ¶
func (db *DB) FetchMismatchedChannels() (*MismatchedChannels, error)
func (*DB) FetchNostrPrivKey ¶
FetchNostrPubKey fetches the nostrPrivatekey for nostr auth.
func (*DB) FetchPaymentGroup ¶
FetchPaymentGroup fetches a a tip message related to payment hash
func (*DB) FetchPaymentRequest ¶
FetchPaymentRequest fetches a payment request by a payment hash
func (*DB) FetchPaymentsSyncInfo ¶
FetchPaymentsSyncInfo returns the last payment time and last invoice settled index. This is used for callers to understand when needs to be synchronized into the db
func (*DB) FetchRedeemablePaymentHashes ¶
func (*DB) FetchReverseSwap ¶
func (db *DB) FetchReverseSwap(hash string) (*data.ReverseSwap, error)
FetchReverseSwap fetches the reverse swap information
func (*DB) FetchSwapAddresses ¶
func (db *DB) FetchSwapAddresses(filterFunc func(addr *SwapAddressInfo) bool) ([]*SwapAddressInfo, error)
func (*DB) FetchTipMessage ¶
FetchTipMessage fetches a a tip message related to payment hash
func (*DB) FetchUnconfirmedClaimTransaction ¶
func (db *DB) FetchUnconfirmedClaimTransaction() (*chainrpc.ConfRequest, error)
FetchUnconfirmedClaimTransaction returns the current unconfirmed claim transaction, or nil if there is no unconfimed claim transaction.
func (*DB) FetchUnspendLockupInformation ¶
func (db *DB) FetchUnspendLockupInformation() (*data.UnspendLockupInformation, error)
FetchUnspendLockupInformation returns the current unconfirmed claim transaction, or nil if there is no unconfimed claim transaction.
func (*DB) FetchZeroConfHashes ¶
FetchZeroConfHashes fetches all zero conf hashes to track
func (*DB) FetchZeroConfInvoice ¶
FetchZeroConfInvoice fetches a zero conf invoice.
func (*DB) GetTorActive ¶
func (*DB) GetTxSpentURL ¶
func (*DB) IsInvoiceHashPaid ¶
IsInvoiceHashPaid returns true if the payReqHash was paid by this client.
func (*DB) MigrateAllLNUrlPayMetadata ¶
func (*DB) RemoveChannelMismatch ¶
func (*DB) RemoveZeroConfHash ¶
RemoveZeroConfHash removes a zero conf hash from tracking.
func (*DB) SaveAccount ¶
SaveAccount saves an account information to the database
func (*DB) SaveLNUrlPayInfo ¶
func (db *DB) SaveLNUrlPayInfo(info *data.LNUrlPayInfo) error
func (*DB) SavePaymentGroup ¶
SavePaymentGroup saves a tip message related to payment hash into the database
func (*DB) SavePaymentRequest ¶
SavePaymentRequest saves a payment request into the database
func (*DB) SaveReverseSwap ¶
func (db *DB) SaveReverseSwap(rs *data.ReverseSwap) (string, error)
SaveReverseSwap saves the reverse swap information
func (*DB) SaveSwapAddressInfo ¶
func (db *DB) SaveSwapAddressInfo(address *SwapAddressInfo) error
func (*DB) SaveTipMessage ¶
SaveTipMessage saves a tip message related to payment hash into the database
func (*DB) SaveUnconfirmedClaimTransaction ¶
func (db *DB) SaveUnconfirmedClaimTransaction(confRequest *chainrpc.ConfRequest) error
SaveUnconfirmedClaimTransaction saves the unconfirmed claim transaction set confRequest to nil when the transaction is confirmed
func (*DB) SaveUnspendLockupInformation ¶
func (db *DB) SaveUnspendLockupInformation(unspendLockupTransaction *data.UnspendLockupInformation) error
SaveUnspendLockupInformation saves the unconfirmed claim transaction set unspendLockupTransaction to nil when the transaction is confirmed
func (*DB) SetLastSyncedHeaderTimestamp ¶
SetLastSyncedHeaderTimestamp saves the last known header timestamp that the node is synced to.
func (*DB) SetMismatchedChannels ¶
func (db *DB) SetMismatchedChannels(mismatched *MismatchedChannels) error
func (*DB) SetTorActive ¶
func (*DB) SetTxSpentURL ¶
func (*DB) UpdateRedeemTxForPayment ¶
func (*DB) UpdateSwapAddress ¶
func (*DB) UpdateSwapAddressByPaymentHash ¶
type MismatchedChannel ¶
type MismatchedChannels ¶
type MismatchedChannels struct { LSPPubkey string ChanPoints []MismatchedChannel }
type PaymentInfo ¶
type PaymentInfo struct { Type PaymentType Amount int64 Fee int64 CreationTimestamp int64 Description string PayeeName string PayeeImageURL string PayerName string PayerImageURL string TransferRequest bool PaymentHash string RedeemTxID string Destination string PendingExpirationHeight uint32 PendingExpirationTimestamp int64 PendingFull bool Preimage string IsKeySend bool GroupKey string GroupName string //For closed channels ClosedChannelPoint string ClosedChannelStatus ChannelCloseStatus ClosedChannelTxID string ClosedChannelRemoteTxID string ClosedChannelSweepTxID string }
PaymentInfo is the structure that holds the data for a payment in breez
type SwapAddressInfo ¶
type SwapAddressInfo struct { LspID string PaymentRequest string Address string CreatedTimestamp int64 // Opening fee params MinMsat uint64 Proportional uint32 ValidUntil string MaxIdleTime uint32 MaxClientToSelfDelay uint32 Promise string //client side data PaymentHash []byte Preimage []byte PrivateKey []byte PublicKey []byte //tracked data ConfirmedTransactionIds []string ConfirmedAmount int64 InvoicedAmount int64 PaidAmount int64 LockHeight uint32 FundingTxID string //address script Script []byte ErrorMessage string SwapErrorReason int32 EnteredMempool bool //refund LastRefundTxID string NonBlocking bool }
SwapAddressInfo contains all the infromation regarding a submarine swap address.
func (*SwapAddressInfo) Confirmed ¶
func (s *SwapAddressInfo) Confirmed() bool
Confirmed returns true if the transaction has confirmed in the past.