2018-10-25 05:31:07 +03:00
|
|
|
// +build walletrpc
|
|
|
|
|
|
|
|
package walletrpc
|
|
|
|
|
|
|
|
import (
|
2020-05-21 02:12:51 +03:00
|
|
|
"github.com/btcsuite/btcd/chaincfg"
|
2018-10-25 05:31:07 +03:00
|
|
|
"github.com/lightningnetwork/lnd/keychain"
|
|
|
|
"github.com/lightningnetwork/lnd/lnwallet"
|
2019-10-31 05:43:05 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
2018-10-25 05:31:07 +03:00
|
|
|
"github.com/lightningnetwork/lnd/macaroons"
|
2019-05-17 05:53:25 +03:00
|
|
|
"github.com/lightningnetwork/lnd/sweep"
|
2018-10-25 05:31:07 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// Config is the primary configuration struct for the WalletKit RPC server. It
|
|
|
|
// contains all the items required for the signer rpc server to carry out its
|
|
|
|
// duties. The fields with struct tags are meant to be parsed as normal
|
|
|
|
// configuration options, while if able to be populated, the latter fields MUST
|
|
|
|
// also be specified.
|
|
|
|
type Config struct {
|
|
|
|
// WalletKitMacPath is the path for the signer macaroon. If unspecified
|
|
|
|
// then we assume that the macaroon will be found under the network
|
|
|
|
// directory, named DefaultWalletKitMacFilename.
|
|
|
|
WalletKitMacPath string `long:"walletkitmacaroonpath" description:"Path to the wallet kit macaroon"`
|
|
|
|
|
|
|
|
// NetworkDir is the main network directory wherein the signer rpc
|
|
|
|
// server will find the macaroon named DefaultWalletKitMacFilename.
|
|
|
|
NetworkDir string
|
|
|
|
|
|
|
|
// MacService is the main macaroon service that we'll use to handle
|
|
|
|
// authentication for the signer rpc server.
|
|
|
|
MacService *macaroons.Service
|
|
|
|
|
|
|
|
// FeeEstimator is an instance of the primary fee estimator instance
|
|
|
|
// the WalletKit will use to respond to fee estimation requests.
|
2019-10-31 05:43:05 +03:00
|
|
|
FeeEstimator chainfee.Estimator
|
2018-10-25 05:31:07 +03:00
|
|
|
|
|
|
|
// Wallet is the primary wallet that the WalletKit will use to proxy
|
|
|
|
// any relevant requests to.
|
|
|
|
Wallet lnwallet.WalletController
|
|
|
|
|
2020-06-10 05:37:17 +03:00
|
|
|
// CoinSelectionLocker allows the caller to perform an operation, which
|
|
|
|
// is synchronized with all coin selection attempts. This can be used
|
|
|
|
// when an operation requires that all coin selection operations cease
|
|
|
|
// forward progress. Think of this as an exclusive lock on coin
|
|
|
|
// selection operations.
|
|
|
|
CoinSelectionLocker sweep.CoinSelectionLocker
|
|
|
|
|
2018-10-25 05:31:07 +03:00
|
|
|
// KeyRing is an interface that the WalletKit will use to derive any
|
|
|
|
// keys due to incoming client requests.
|
|
|
|
KeyRing keychain.KeyRing
|
2019-05-17 05:53:25 +03:00
|
|
|
|
|
|
|
// Sweeper is the central batching engine of lnd. It is responsible for
|
|
|
|
// sweeping inputs in batches back into the wallet.
|
|
|
|
Sweeper *sweep.UtxoSweeper
|
2019-08-22 03:24:07 +03:00
|
|
|
|
|
|
|
// Chain is an interface that the WalletKit will use to determine state
|
|
|
|
// about the backing chain of the wallet.
|
|
|
|
Chain lnwallet.BlockChainIO
|
2020-05-21 02:12:51 +03:00
|
|
|
|
|
|
|
// ChainParams are the parameters of the wallet's backing chain.
|
|
|
|
ChainParams *chaincfg.Params
|
2018-10-25 05:31:07 +03:00
|
|
|
}
|