staticutil

package
v0.31.8-beta Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 15 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) (
	[]*deposit.Deposit, error)

SelectDeposits sorts the deposits by amount in descending order. It then selects the deposits that are needed to cover the amount requested without leaving a dust change. It returns an error if the sum of deposits minus dust is less than the requested amount.

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