Documentation ¶
Index ¶
- type Handler
- func (w *Handler) AutoWithdrawBalances(ctxCtx context.Context) error
- func (w *Handler) CompleteAllPendingWithdrawals(ctxCtx context.Context) error
- func (w *Handler) CompleteWithdrawal(ctxCtx context.Context, pending *types.PendingWithdrawal, recvPending bool) error
- func (w *Handler) CompleteWithdrawals(ctxCtx context.Context, pending []*types.PendingWithdrawal) error
- func (w *Handler) PendingWithdrawalsCreated() event.Event[[]*types.PendingWithdrawal]
- func (w *Handler) WithdrawBalances(ctxCtx context.Context, balances []*types.RewardBalance) error
- func (w *Handler) Worker(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles withdrawals
func (*Handler) AutoWithdrawBalances ¶
AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
func (*Handler) CompleteAllPendingWithdrawals ¶
CompleteAllPendingWithdrawals completes all pending withdrawals If the process is interrupted, it's possible that not all pending withdrawals will have gone out In that case, the ones that did not go out will remain as pending withdrawals
func (*Handler) CompleteWithdrawal ¶
func (w *Handler) CompleteWithdrawal(ctxCtx context.Context, pending *types.PendingWithdrawal, recvPending bool) error
CompleteWithdrawal completes the specified withdrawal in a fully separate database transaction (do not pass a transaction as context) It removes the pending withdrawal, sends the transaction to the network and creates a matching completed withdrawal
func (*Handler) CompleteWithdrawals ¶
func (w *Handler) CompleteWithdrawals(ctxCtx context.Context, pending []*types.PendingWithdrawal) error
CompleteWithdrawals completes the specified pending withdrawals (do not pass a transaction as context) If the process is interrupted, it's possible that not all pending withdrawals will have gone out In that case, the ones that did not go out will remain as pending withdrawals
func (*Handler) PendingWithdrawalsCreated ¶
func (w *Handler) PendingWithdrawalsCreated() event.Event[[]*types.PendingWithdrawal]
PendingWithdrawalsCreated is the event that is fired when new pending withdrawals are created
func (*Handler) WithdrawBalances ¶
WithdrawBalances initiates withdraws for the specified balances