swapfunds

package
v0.0.0-...-ddb1edc Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	cfg *config.Config,
	breezDB *db.DB,
	breezAPI services.API,
	daemonAPI lnnode.API,
	sendPayment func(payreq string, amount int64, lastHopPubkey []byte, fee int64) (string, error),
	addInvoice func(invoiceRequest *data.AddInvoiceRequest) (paymentRequest string, lspFee int64, err error),
	lspList func() (*data.LSPList, error),
	getGlobalReceiveLimit func() (maxReceive int64, err error),
	onServiceEvent func(data.NotificationEvent)) (*Service, error)

func (*Service) AddFundsInit

func (s *Service) AddFundsInit(notificationToken, lspID string, params *data.OpeningFeeParams) (*data.AddFundInitReply, error)

AddFundsInit is responsible for topping up an existing channel

func (*Service) ClaimFeeEstimates

func (s *Service) ClaimFeeEstimates(claimAddress string) (map[int32]int64, error)

func (*Service) FetchReverseSwap

func (s *Service) FetchReverseSwap(hash string) (*data.ReverseSwap, error)

func (*Service) GetFundStatus

func (s *Service) GetFundStatus(notificationToken string) (*data.FundStatusReply, error)

GetFundStatus gets a notification token and does two things: 1. Register for notifications on all saved addresses 2. Fetch the current status for the saved addresses from the server

func (*Service) NewReverseSwap

func (s *Service) NewReverseSwap(amt int64, feesHash, claimAddress string) (string, error)

func (*Service) PayReverseSwap

func (s *Service) PayReverseSwap(hash, deviceID, title, body string, fee int64) error

func (*Service) Refund

func (s *Service) Refund(address, refundAddress string, targetConf int32, satPerByte int64) (string, error)

Refund broadcast a refund transaction for a sub swap address.

func (*Service) RefundFees

func (s *Service) RefundFees(address, refundAddress string, targetConf int32, satPerByte int64) (int64, error)

RefundFees return the fees of a refund transaction for a sub swap address.

func (*Service) ResetUnconfirmedReverseSwapClaimTransaction

func (s *Service) ResetUnconfirmedReverseSwapClaimTransaction() error

func (*Service) ReverseRoutingNode

func (s *Service) ReverseRoutingNode() []byte

func (*Service) ReverseSwapPayments

func (s *Service) ReverseSwapPayments() (*data.ReverseSwapPaymentStatuses, error)

func (*Service) SetNonBlockingUnconfirmed

func (s *Service) SetNonBlockingUnconfirmed() error

func (*Service) SetReverseSwapClaimFee

func (s *Service) SetReverseSwapClaimFee(hash string, fee int64) error

func (*Service) SettlePendingTransfers

func (s *Service) SettlePendingTransfers()

SettlePendingTransfers watch for routing peer connection and once connected it does two things:

  1. Ask the breez server to pay in lightning for addresses that the user has sent funds to and that the funds are confirmred
  2. Ask the breez server to pay on-chain for funds were sent to him in lightning as part of the remove funds flow

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) UnconfirmedReverseSwapClaimTransaction

func (s *Service) UnconfirmedReverseSwapClaimTransaction() (string, error)

Jump to

Keyboard shortcuts

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