mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +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.
53 lines
1.7 KiB
Go
53 lines
1.7 KiB
Go
package deposit
|
|
|
|
import (
|
|
"context"
|
|
|
|
btcaddr "github.com/btcsuite/btcd/address/v2"
|
|
"github.com/btcsuite/btcd/btcec/v2"
|
|
"github.com/lightninglabs/loop/staticaddr/script"
|
|
"github.com/lightningnetwork/lnd/lnwallet"
|
|
)
|
|
|
|
const (
|
|
IdLength = 32
|
|
)
|
|
|
|
// Store is the database interface that is used to store and retrieve
|
|
// static address deposits.
|
|
type Store interface {
|
|
// CreateDeposit inserts a new deposit into the store.
|
|
CreateDeposit(ctx context.Context, deposit *Deposit) error
|
|
|
|
// UpdateDeposit updates the deposit in the database.
|
|
UpdateDeposit(ctx context.Context, deposit *Deposit) error
|
|
|
|
// GetDeposit retrieves a deposit with depositID from the database.
|
|
GetDeposit(ctx context.Context, depositID ID) (*Deposit, error)
|
|
|
|
// DepositForOutpoint retrieves the deposit with the given outpoint.
|
|
DepositForOutpoint(ctx context.Context, outpoint string) (*Deposit,
|
|
error)
|
|
|
|
// AllDeposits retrieves all deposits from the store.
|
|
AllDeposits(ctx context.Context) ([]*Deposit, error)
|
|
}
|
|
|
|
// 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)
|
|
|
|
// ListUnspent returns a list of utxos at the static address.
|
|
ListUnspent(ctx context.Context, minConfs,
|
|
maxConfs int32) ([]*lnwallet.Utxo, error)
|
|
|
|
// GetTaprootAddress returns a taproot address.
|
|
GetTaprootAddress(clientPubkey, serverPubkey *btcec.PublicKey,
|
|
expiry int64) (*btcaddr.AddressTaproot, error)
|
|
}
|