// AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
// AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
func (w *WithdrawalHandler) AutoWithdrawBalances(ctxCtx context.Context) error {
	ctx, err := BeginTransaction(ctxCtx)
	if err != nil {
		return stacktrace.Propagate(err, "")
	}
	defer ctx.Rollback()
	threshold := new(big.Int).Mul(BananoUnit, big.NewInt(10)) 
	balances, err := types.GetRewardBalancesReadyForAutoWithdrawal(ctx, decimal.NewFromBigInt(threshold, 0), time.Now().Add(-24*time.Hour))
	if err != nil {
		return stacktrace.Propagate(err, "")
	}
	err = w.WithdrawBalances(ctx, balances)
	if err != nil {
		return stacktrace.Propagate(err, "")
	}
	return stacktrace.Propagate(ctx.Commit(), "")
}
func ( w * WithdrawalHandler ) AutoWithdrawBalances ( ctxCtx context . Context ) error { ctx , err := BeginTransaction ( ctxCtx ) if err != nil { return stacktrace . Propagate ( err , " " ) } defer ctx . Rollback ( ) threshold := new ( big . Int ) . Mul ( BananoUnit , big . NewInt ( 10 ) ) balances , err := types . GetRewardBalancesReadyForAutoWithdrawal ( ctx , decimal . NewFromBigInt ( threshold , 0 ) , time . Now ( ) . Add ( - 24 * time . Hour ) ) if err != nil { return stacktrace . Propagate ( err , " " ) } err = w . WithdrawBalances ( ctx , balances ) if err != nil { return stacktrace . Propagate ( err , " " ) } return stacktrace . Propagate ( ctx . Commit ( ) , " " ) }
AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
AutoWithdrawBalances initiates withdrawals for all balances that match the automatic withdrawal criteria
// 10 BAN