mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
The Parameters struct describes the keys, expiry and pkScript that define the static address script, so its natural home is the script package. Moving it there lets staticutil drop its dependency on the address package and lets callers reuse a single type alongside script.StaticAddress and script.NewStaticAddress. No behavior change. Closes #1056
34 lines
1 KiB
Go
34 lines
1 KiB
Go
package withdraw
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/btcsuite/btcd/wire"
|
|
"github.com/lightninglabs/loop/fsm"
|
|
"github.com/lightninglabs/loop/staticaddr/deposit"
|
|
"github.com/lightninglabs/loop/staticaddr/script"
|
|
)
|
|
|
|
// AddressManager handles fetching of address parameters.
|
|
type AddressManager interface {
|
|
// GetStaticAddressParameters returns the static address parameters.
|
|
GetStaticAddressParameters(ctx context.Context) (*script.Parameters,
|
|
error)
|
|
|
|
// GetStaticAddress returns the deposit address for the given
|
|
// client and server public keys.
|
|
GetStaticAddress(ctx context.Context) (*script.StaticAddress, error)
|
|
}
|
|
|
|
type DepositManager interface {
|
|
GetActiveDepositsInState(stateFilter fsm.StateType) ([]*deposit.Deposit,
|
|
error)
|
|
|
|
AllOutpointsActiveDeposits(outpoints []wire.OutPoint,
|
|
stateFilter fsm.StateType) ([]*deposit.Deposit, bool)
|
|
|
|
TransitionDeposits(ctx context.Context, deposits []*deposit.Deposit,
|
|
event fsm.EventType, expectedFinalState fsm.StateType) error
|
|
|
|
UpdateDeposit(ctx context.Context, d *deposit.Deposit) error
|
|
}
|