github.com/decred/dcrlnd@v0.7.6/lnwallet/extended_interface.go (about) 1 package lnwallet 2 3 import ( 4 "errors" 5 "time" 6 7 "github.com/decred/dcrd/chaincfg/chainhash" 8 "github.com/decred/dcrd/dcrec/secp256k1/v4" 9 "github.com/decred/dcrd/txscript/v4/stdaddr" 10 "github.com/decred/dcrd/wire" 11 ) 12 13 type WalletTransaction struct { 14 RawTx []byte 15 Confirmations int32 16 BlockHash *chainhash.Hash 17 } 18 19 var ErrWalletTxNotExist = errors.New("tx does not exist in wallet") 20 21 // ExtendedWalletController offers extended actions for the wallet (ones defined 22 // only in dcrlnd). 23 type ExtendedWalletController interface { 24 // DeriveNextAccount derives a new account master key and stores it 25 // as a new account with the specified name. 26 DeriveNextAccount(name string) error 27 28 // ExportPrivKey returns the private key for a wallet-controlled 29 // address. 30 ExportPrivKey(addr stdaddr.Address) (*secp256k1.PrivateKey, error) 31 32 // RescanWallet performs a wallet rescan for transactions. 33 RescanWallet(startHeight int32, progress func(height int32) error) error 34 35 // GetWalletTransaction returns information about a transaction that 36 // belongs to the wallet. If the transaction does not exist in the 37 // wallet, then ErrWalletTxNotExist should be returned. 38 GetWalletTransaction(tx chainhash.Hash) (*WalletTransaction, error) 39 } 40 41 // LockedOutput is a type that contains an outpoint of an UTXO and its lock lease 42 // information. 43 type LockedOutput struct { 44 LockID LockID 45 Outpoint wire.OutPoint 46 Expiration time.Time 47 }