github.com/decred/dcrlnd@v0.7.6/lnwallet/remotedcrwallet/config.go (about) 1 package remotedcrwallet 2 3 import ( 4 "github.com/decred/dcrd/chaincfg/v3" 5 "github.com/decred/dcrlnd/blockcache" 6 "github.com/decred/dcrlnd/channeldb" 7 "github.com/decred/dcrlnd/lnwallet" 8 "github.com/decred/dcrlnd/lnwallet/chainfee" 9 "google.golang.org/grpc" 10 ) 11 12 // WalletSyncer is an exported interface for the available wallet sync backends 13 // (RPC, SPV, etc). While this interface is exported to ease construction of a 14 // Config structure, only implementations provided by this package are 15 // supported, since currently the implementation is tightly coupled to the 16 // DcrWallet struct. 17 // 18 // The current backend implementations also implement the BlockChainIO 19 // interface. 20 type WalletSyncer interface { 21 lnwallet.BlockChainIO 22 23 start(w *DcrWallet) error 24 stop() 25 } 26 27 // Config is a struct which houses configuration parameters which modify the 28 // instance of DcrWallet generated by the New() function. 29 type Config struct { 30 // PrivatePass is the private password to the underlying dcrwallet 31 // instance. Without this, the wallet cannot be decrypted and operated. 32 PrivatePass []byte 33 34 // FeeEstimator is an instance of the fee estimator interface which 35 // will be used by the wallet to dynamically set transaction fees when 36 // crafting transactions. 37 FeeEstimator chainfee.Estimator 38 39 // NetParams is the net parameters for the target chain. 40 NetParams *chaincfg.Params 41 42 // Conn is a grpc connection to an already opened wallet. This needs to 43 // be filled for the wallet to work. 44 Conn *grpc.ClientConn 45 46 // AccountNumber is the account number to use to perform the ln 47 // operations. 48 AccountNumber int32 49 50 // ChainIO is a direct connection to the blockchain IO driver needed by 51 // the wallet. 52 // 53 // TODO(decred) Ideally this should be performed by wallet operations 54 // but not all operations needed by the drivers are currently 55 // implemented in the wallet. 56 ChainIO lnwallet.BlockChainIO 57 58 // BlockCache is an optional in-memory block cacher. 59 BlockCache *blockcache.BlockCache 60 61 DB *channeldb.DB 62 }