Skip to content

Commit

Permalink
staticaddr: deposit related interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Dec 22, 2023
1 parent 5764514 commit 6035e82
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions staticaddr/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/keychain"
)

Expand Down Expand Up @@ -35,6 +36,15 @@ type AddressStore interface {
// GetAllStaticAddresses retrieves all static addresses from the store.
GetAllStaticAddresses(ctx context.Context) (
[]*AddressParameters, error)

// CreateDeposit inserts a new deposit into the store.
CreateDeposit(ctx context.Context, deposit *Deposit) error

// AllDeposits retrieves all deposits from the store.
AllDeposits(ctx context.Context) ([]Deposit, error)

// DeleteDeposit deletes a deposit from the store.
DeleteDeposit(ctx context.Context, deposit *Deposit) error
}

// ID is a unique identifier for a address.
Expand Down Expand Up @@ -82,3 +92,13 @@ type AddressParameters struct {
// ProtocolVersion is the protocol version of the static address.
ProtocolVersion AddressProtocolVersion
}

// Deposit bundles an utxo at a static address together with manager-relevant
// data.
type Deposit struct {
wire.OutPoint
Value btcutil.Amount
ConfirmationHeight int64
TimeOutSweepPkScript []byte
Spent bool
}

0 comments on commit 6035e82

Please sign in to comment.