staticutil

package
v0.32.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMusig2Session

func CreateMusig2Session(ctx context.Context,
	signer lndclient.SignerClient, addrParams *address.Parameters,
	staticAddress *script.StaticAddress) (*input.MuSig2SessionInfo, error)

CreateMusig2Session creates a musig2 session for the deposit.

func CreateMusig2Sessions

func CreateMusig2Sessions(ctx context.Context,
	signer lndclient.SignerClient, deposits []*deposit.Deposit,
	addrParams *address.Parameters,
	staticAddress *script.StaticAddress) ([]*input.MuSig2SessionInfo,
	[][]byte, error)

CreateMusig2Sessions creates a musig2 session for a number of deposits.

func CreateMusig2SessionsPerDeposit

func CreateMusig2SessionsPerDeposit(ctx context.Context,
	signer lndclient.SignerClient, deposits []*deposit.Deposit,
	addrParams *address.Parameters,
	staticAddress *script.StaticAddress) (
	map[string]*input.MuSig2SessionInfo, map[string][]byte, map[string]int,
	error)

CreateMusig2SessionsPerDeposit creates a musig2 session for a number of deposits.

func GetPrevoutInfo

func GetPrevoutInfo(prevOuts map[wire.OutPoint]*wire.TxOut,
) []*swapserverrpc.PrevoutInfo

GetPrevoutInfo converts a map of prevOuts to protobuf.

func SelectDeposits

func SelectDeposits(deposits []*deposit.Deposit, amount int64,
	feeRate chainfee.SatPerKWeight,
	commitmentType lnrpc.CommitmentType) ([]*deposit.Deposit, error)

SelectDeposits sorts the deposits by amount in descending order. It then selects the deposits that are needed to cover the requested amount plus transaction fees and dust. The fee rate and commitment type are used to estimate the transaction fee for the current selection, since each additional input increases the fee.

func ToPrevOuts

func ToPrevOuts(deposits []*deposit.Deposit,
	pkScript []byte) (map[wire.OutPoint]*wire.TxOut, error)

ToPrevOuts converts a slice of deposits to a map of outpoints to TxOuts.

func ToWireOutpoints

func ToWireOutpoints(outpoints []*lnrpc.OutPoint) ([]wire.OutPoint, error)

ToWireOutpoints converts lnrpc.OutPoint protos into wire.OutPoint structs so they can be consumed by lower level transaction building code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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