func (j *AccountStatistics) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"id":`)
	{
		obj, err = j.ID.MarshalJSON()
		if err != nil {
			return err
		}
		buf.Write(obj)
	}
	buf.WriteString(`,"most_recent_op":`)
	{
		obj, err = j.MostRecentOp.MarshalJSON()
		if err != nil {
			return err
		}
		buf.Write(obj)
	}
	buf.WriteString(`,"owner":`)
	{
		obj, err = j.Owner.MarshalJSON()
		if err != nil {
			return err
		}
		buf.Write(obj)
	}
	buf.WriteString(`,"lifetime_fees_paid":`)
	fflib.FormatBits2(buf, uint64(j.LifetimeFeesPaid), 10, false)
	buf.WriteString(`,"pending_fees":`)
	fflib.FormatBits2(buf, uint64(j.PendingFees), 10, false)
	buf.WriteString(`,"pending_vested_fees":`)
	fflib.FormatBits2(buf, uint64(j.PendingVestedFees), 10, false)
	buf.WriteString(`,"removed_ops":`)
	fflib.FormatBits2(buf, uint64(j.RemovedOps), 10, false)
	buf.WriteString(`,"total_ops":`)
	fflib.FormatBits2(buf, uint64(j.TotalOps), 10, false)
	buf.WriteString(`,"total_core_in_orders":`)
	fflib.FormatBits2(buf, uint64(j.TotalCoreInOrders), 10, false)
	buf.WriteByte('}')
	return nil
}
MarshalJSONBuf marshal buff to json - template
package types
import (
	"bytes"
	"fmt"
	fflib "github.com/pquerna/ffjson/fflib/v1"
)
func (j *AccountStatistics) MarshalJSON() ([]byte, error) {
	var buf fflib.Buffer
	if j == nil {
		buf.WriteString("null")
		return buf.Bytes(), nil
	}
	err := j.MarshalJSONBuf(&buf)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}