unroll

package
v0.0.0-...-7707f99 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWaitingForConfirmation = fmt.Errorf("waiting for confirmation(s), please retry later")

Functions

func CompleteUnroll

func CompleteUnroll(ctx context.Context, args CompleteUnrollArgs) (string, error)

CompleteUnroll spends the user's matured onchain Ark UTXOs (those past their exit delay) to args.Receiver, signs the resulting transaction and broadcasts it. Returns the broadcast response from the explorer.

Types

type CompleteUnrollArgs

type CompleteUnrollArgs struct {
	Explorer     clientlib.Explorer
	SignTx       clientlib.SignFn
	ServerParams clientlib.ServerParams
	Utxos        []clientlib.Utxo
	Receiver     string
}

CompleteUnrollArgs configures CompleteUnroll: spends the user's matured onchain Ark UTXOs (those past their exit delay) to Receiver and broadcasts the resulting transaction.

type ErrPendingConfirmation

type ErrPendingConfirmation struct {
	Txid string
}

ErrPendingConfirmation is returned when computing the offchain path of a redeem branch. Due to P2A relay policy, only 1C1P packages are accepted. This error is returned when the tx is found onchain but not confirmed yet, allowing the user to know when to wait for the tx to be confirmed or to continue with the redemption.

func (ErrPendingConfirmation) Error

func (e ErrPendingConfirmation) Error() string

type RedeemBranch

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

func NewRedeemBranch

func NewRedeemBranch(
	ctx context.Context,
	explorer clientlib.Explorer, indexer clientlib.Indexer, vtxo clientlib.Vtxo,
) (*RedeemBranch, error)

func (*RedeemBranch) ExpiresAt

func (r *RedeemBranch) ExpiresAt() (*time.Time, error)

func (*RedeemBranch) NextRedeemTx

func (r *RedeemBranch) NextRedeemTx() (string, error)

RedeemPath returns the list of transactions to broadcast in order to access the vtxo output due to current P2A relay policy, we can't broadcast the branch tx until its parent tx is confirmed so we'll broadcast only the first tx of every branch

type UnrollArgs

type UnrollArgs struct {
	Explorer     clientlib.Explorer
	Indexer      clientlib.Indexer
	SignTx       clientlib.SignFn
	ServerParams clientlib.ServerParams
	Vtxos        []clientlib.Vtxo
	BumpAddr     string
	BumpPubKey   *btcec.PublicKey
}

UnrollArgs configures Unroll: builds 1C1P bump packages for each given vtxo's next branch tx and broadcasts each parent+child pair.

type UnrollRes

type UnrollRes struct {
	ParentTx   string
	ParentTxid string
	ChildTx    string
	ChildTxid  string
}

UnrollRes is the result of a single Unroll iteration (one parent + child 1C1P package).

func Unroll

func Unroll(ctx context.Context, args UnrollArgs) ([]UnrollRes, error)

Unroll iterates over each vtxo's redeem branch, builds a 1C1P bump package (parent branch tx + child anchor-bumping tx) and broadcasts the package.

Jump to

Keyboard shortcuts

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