Documentation
¶
Index ¶
- Variables
- func UseLogger(logger btclog.Logger)
- type AddressManager
- type DepositManager
- type Manager
- func (m *Manager) DeliverWithdrawalRequest(ctx context.Context, outpoints []wire.OutPoint, destAddr string, ...) (string, string, error)
- func (m *Manager) Run(ctx context.Context, currentHeight uint32) error
- func (m *Manager) WaitInitComplete()
- func (m *Manager) WithdrawDeposits(ctx context.Context, outpoints []wire.OutPoint, destAddr string, ...) (string, string, error)
- type ManagerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrWithdrawingInactiveDeposits is returned when the user tries to // withdraw inactive deposits. ErrWithdrawingInactiveDeposits = errors.New("deposits to be " + "withdrawn are unknown or inactive") // MinConfs is the minimum number of confirmations we require for a // deposit to be considered withdrawn. MinConfs int32 = 3 )
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) // ListUnspent returns a list of utxos at the static address. ListUnspent(ctx context.Context, minConfs, maxConfs int32) ([]*lnwallet.Utxo, error) }
AddressManager handles fetching of address parameters.
type DepositManager ¶
type DepositManager interface { GetActiveDepositsInState(stateFilter fsm.StateType) ([]*deposit.Deposit, error) AllOutpointsActiveDeposits(outpoints []wire.OutPoint, stateFilter fsm.StateType) ([]*deposit.Deposit, bool) TransitionDeposits(ctx context.Context, deposits []*deposit.Deposit, event fsm.EventType, expectedFinalState fsm.StateType) error UpdateDeposit(ctx context.Context, d *deposit.Deposit) error }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the withdrawal state machines.
func NewManager ¶
func NewManager(cfg *ManagerConfig) *Manager
NewManager creates a new deposit withdrawal manager.
func (*Manager) DeliverWithdrawalRequest ¶
func (m *Manager) DeliverWithdrawalRequest(ctx context.Context, outpoints []wire.OutPoint, destAddr string, satPerVbyte int64) (string, string, error)
DeliverWithdrawalRequest forwards a withdrawal request to the manager main loop.
func (*Manager) WaitInitComplete ¶
func (m *Manager) WaitInitComplete()
WaitInitComplete waits until the address manager has completed its setup.
type ManagerConfig ¶
type ManagerConfig struct { // StaticAddressServerClient is the client that calls the swap server // rpcs to negotiate static address withdrawals. StaticAddressServerClient staticaddressrpc.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 // 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 }
ManagerConfig holds the configuration for the address manager.
Click to show internal directories.
Click to hide internal directories.