Documentation ¶
Index ¶
Constants ¶
const DustThreshold = 546
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisStatus ¶
type AnalysisStatus string
const ( AnalysisStatusOk AnalysisStatus = "Ok" AnalysisStatusAmountGreaterThanBalance AnalysisStatus = "GreaterThanBalance" AnalysisStatusAmountTooSmall AnalysisStatus = "AmountTooSmall" AnalysisStatusUnpayable AnalysisStatus = "Unpayable" )
type FeeWindow ¶
func (*FeeWindow) FastestFeeRate ¶ added in v0.10.0
FastestFeeRate gets the fastest fee rate, in satoshis per weight unit.
func (*FeeWindow) MinimumFeeRate ¶ added in v0.10.0
MinimumFeeRate gets the minimum available fee rate that will hit a given confirmation target. We make no guesses (no averages or interpolations), so we might overshoot the fee if data is too sparse. Note: the lower the confirmation target, the faster the tx will confirm, and greater the fee(rate) will be.
func (*FeeWindow) NextHighestBlock ¶ added in v0.10.0
NextHighestBlock finds the next highest confirmation/block target for a certain feeRate. Let me explain, we have a map that associates a conf-target with a fee rate. Now we want to know associate a conf-target with a given fee rate. We want the NEXT conf-target as we usually want this data for predictions or estimations and this makes the predictions for the fee rate to "fall on the correct side" (e.g when estimating max time to confirmation for a given fee rate). Note: code is not our best work of art. The target < next comparison is to account for our TargetedFees map not necessarily being sorted.
type NextTransactionSize ¶
type NextTransactionSize struct { SizeProgression []SizeForAmount ExpectedDebtInSat int64 }
func (*NextTransactionSize) TotalBalance ¶
func (nts *NextTransactionSize) TotalBalance() int64
func (*NextTransactionSize) UtxoBalance ¶
func (nts *NextTransactionSize) UtxoBalance() int64
type PaymentAnalysis ¶
type PaymentAnalyzer ¶ added in v0.10.0
type PaymentAnalyzer struct {
// contains filtered or unexported fields
}
func NewPaymentAnalyzer ¶
func NewPaymentAnalyzer(feeWindow *FeeWindow, nts *NextTransactionSize) *PaymentAnalyzer
func (*PaymentAnalyzer) MaxFeeRateToAddress ¶ added in v0.10.0
func (a *PaymentAnalyzer) MaxFeeRateToAddress(payment *PaymentToAddress) float64
MaxFeeRateToAddress computes the maximum fee rate that can be used when paying a given amount. This does not imply that the payment _can be made_. When given invalid parameters, it's likely to still obtain a value here and the resulting analysis would be Unpayable. It's up to the caller to first verify the amount is payable, and only then call this method.
func (*PaymentAnalyzer) ToAddress ¶ added in v0.10.0
func (a *PaymentAnalyzer) ToAddress(payment *PaymentToAddress) (*PaymentAnalysis, error)
func (*PaymentAnalyzer) ToInvoice ¶ added in v0.10.0
func (a *PaymentAnalyzer) ToInvoice(payment *PaymentToInvoice) (*PaymentAnalysis, error)
type PaymentToAddress ¶
type PaymentToInvoice ¶
type PaymentToInvoice struct { TakeFeeFromAmount bool AmountInSat int64 SwapFees *fees.SwapFees // Nullable before we know the paymentAmount for amountless invoice BestRouteFees []fees.BestRouteFees // Nullable when we know the amount beforehand (invoice with amount) FundingOutputPolicies *fees.FundingOutputPolicies // Nullable when we know the amount beforehand (invoice with amount) }