package
0.29.0-beta.rc2
Repository: https://github.com/lightninglabs/loop.git
Documentation: pkg.go.dev

# Functions

CalcFee returns the swap fee for a given swap amount.
DecodeInvoice gets the destination, hash and the amount of an invoice.
FeeRateAsPercentage converts a feerate to a percentage.
GenSuccessPathScript constructs an HtlcScript for the success payment path.
GenTimeoutPathScript constructs an HtlcScript for the timeout payment path.
GetScriptOutput locates the given script in the outputs of a transaction and returns its outpoint and value.
GetTxInputByOutpoint returns a tx input based on a given input outpoint.
NewHtlcV2 returns a new V2 (P2WSH) HTLC instance.
NewHtlcV3 returns a new V3 HTLC (P2TR) instance.
ShortHash returns a shortened version of the hash suitable for use in logging.

# Constants

FeeRateTotalParts defines the granularity of the fee rate.
HtlcP2TR is a pay-to-taproot output with three separate spend paths.
HtlcP2WSH is a pay-to-witness-script-hash output (segwit only).
HtlcV2 refers to the improved version of the HTLC script.
HtlcV3 refers to an upgraded version of HtlcV2 implemented with tapscript.
TypeIn is a loop in swap.
TypeOut is a loop out swap.

# Variables

ErrInvalidOutputSelected is returned when a taproot output is selected for a v2 script.
ErrInvalidOutputType is returned when an unknown output type is associated with a certain swap htlc.
ErrInvalidScriptVersion is returned when an unknown htlc version is provided to NewHtlc.
KeyFamily is the key family used to generate keys that allow spending of the htlc.
QuoteHtlcP2TR is a template script just used for sweep fee estimation.
QuoteHtlcP2WSH is a template script just used for sweep fee estimation.
StaticAddressKeyFamily is the key family used to generate static address keys.

# Structs

Htlc contains relevant htlc information from the receiver perspective.
HtlcScriptV2 encapsulates the htlc v2 script.
HtlcScriptV3 encapsulates the htlc v3 script.
PrefixLog logs with a short swap hash prefix.

# Interfaces

HtlcScript defines an interface for the different HTLC implementations.

# Type aliases

HtlcOutputType defines the output type of the htlc that is published.
ScriptVersion defines the HTLC script version.
Type indicates the type of swap.