Documentation
¶
Index ¶
Constants ¶
View Source
const Subsystem = "SCHOPEN"
Subsystem defines the sub system name of this package.
Variables ¶
View Source
var (
"not usable to open a channel with")
)
Functions ¶
Types ¶
type AddressManager ¶
type AddressManager interface {
// GetStaticAddressParameters returns the static address parameters.
GetStaticAddressParameters(ctx context.Context) (*address.Parameters,
error)
// GetStaticAddress returns the deposit address for the given
// client and server public keys.
GetStaticAddress(ctx context.Context) (*script.StaticAddress, error)
}
AddressManager handles fetching of address parameters.
type Config ¶
type Config struct {
// StaticAddressServerClient is the client that calls the swap server
// rpcs to negotiate static address withdrawals.
Server serverrpc.StaticAddressServerClient
// AddressManager gives the withdrawal manager access to static address
// parameters.
AddressManager AddressManager
// DepositManager gives the withdrawal manager access to the deposits
// enabling it to create and manage withdrawals.
DepositManager DepositManager
// WithdrawalManager is used to create the withdrawal transaction into
// the channel funding address.
WithdrawalManager WithdrawalManager
// WalletKit is the wallet client that is used to derive new keys from
// lnd's wallet.
WalletKit lndclient.WalletKitClient
// ChainParams is the chain configuration(mainnet, testnet...) this
// manager uses.
ChainParams *chaincfg.Params
// ChainNotifier is the chain notifier that is used to listen for new
// blocks.
ChainNotifier lndclient.ChainNotifierClient
// Signer is the signer client that is used to sign transactions.
Signer lndclient.SignerClient
// LightningClient is the lnd client that is used to open channels.
LightningClient lndclient.LightningClient
}
Config is the configuration struct for the open channel manager.
type DepositManager ¶
type DepositManager interface {
// AllOutpointsActiveDeposits returns all deposits that are in the
// given state. If the state filter is fsm.StateTypeNone, all deposits
// are returned.
AllOutpointsActiveDeposits(outpoints []wire.OutPoint,
stateFilter fsm.StateType) ([]*deposit.Deposit, bool)
// GetActiveDepositsInState returns all deposits that are in the
// given state.
GetActiveDepositsInState(stateFilter fsm.StateType) ([]*deposit.Deposit,
error)
// TransitionDeposits transitions the deposits to the given state.
TransitionDeposits(ctx context.Context, deposits []*deposit.Deposit,
event fsm.EventType, expectedFinalState fsm.StateType) error
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the main struct that handles the open channel manager.
func (*Manager) DeliverOpenChannelRequest ¶
func (m *Manager) DeliverOpenChannelRequest(ctx context.Context, req *lnrpc.OpenChannelRequest) (*wire.OutPoint, error)
DeliverOpenChannelRequest forwards a open channel request to the manager main loop.
func (*Manager) OpenChannel ¶
func (m *Manager) OpenChannel(ctx context.Context, req *lnrpc.OpenChannelRequest) (*wire.OutPoint, error)
OpenChannel transitions the requested deposits into the OpeningChannel state and then starts the open channel psbt flow between the client's lnd instance and the server.
type WithdrawalManager ¶
Click to show internal directories.
Click to hide internal directories.