mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-17 13:06:51 +02:00
Update LND, Aperture, and Taproot Assets to revisions using the btcd v2 modules, and update lndclient to v0.21.0-3. Migrate Loop chain, transaction, and address types to their corresponding v2 packages. The lndclient release includes the migration from: https://github.com/lightninglabs/lndclient/pull/280 Taproot Assets is temporarily replaced with its btcd v2 revision because the v0.8 release branch has not adopted the new modules. This raises the minimum Go version to 1.26 and changes exported address types.
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package openchannel
|
|
|
|
import (
|
|
"context"
|
|
|
|
btcaddr "github.com/btcsuite/btcd/address/v2"
|
|
"github.com/btcsuite/btcd/wire/v2"
|
|
"github.com/lightninglabs/loop/fsm"
|
|
"github.com/lightninglabs/loop/staticaddr/deposit"
|
|
"github.com/lightningnetwork/lnd/lnrpc"
|
|
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
|
)
|
|
|
|
type DepositManager interface {
|
|
// EnsureDepositsFresh reconciles active deposits with the wallet view.
|
|
EnsureDepositsFresh(ctx context.Context) error
|
|
|
|
// AllOutpointsActiveDeposits returns all deposits that are in the
|
|
// given state. If the state filter is fsm.StateTypeNone, all deposits
|
|
// are returned.
|
|
AllOutpointsActiveDeposits(outpoints []wire.OutPoint,
|
|
stateFilter fsm.StateType) ([]*deposit.Deposit, bool)
|
|
|
|
// GetActiveDepositsInState returns all deposits that are in the
|
|
// given state.
|
|
GetActiveDepositsInState(stateFilter fsm.StateType) ([]*deposit.Deposit,
|
|
error)
|
|
|
|
// TransitionDeposits transitions the deposits to the given state.
|
|
TransitionDeposits(ctx context.Context, deposits []*deposit.Deposit,
|
|
event fsm.EventType, expectedFinalState fsm.StateType) error
|
|
}
|
|
|
|
type WithdrawalManager interface {
|
|
CreateFinalizedWithdrawalTx(ctx context.Context,
|
|
deposits []*deposit.Deposit, withdrawalAddress btcaddr.Address,
|
|
feeRate chainfee.SatPerKWeight,
|
|
selectedWithdrawalAmount int64,
|
|
commitmentType lnrpc.CommitmentType) (*wire.MsgTx, []byte, error)
|
|
}
|