func (j *BroadcastResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"id":`)
	fflib.WriteJsonString(buf, string(j.ID))
	buf.WriteString(`,"block_num":`)
	fflib.FormatBits2(buf, uint64(j.BlockNum), 10, false)
	buf.WriteString(`,"trx_num":`)
	fflib.FormatBits2(buf, uint64(j.TrxNum), 10, false)
	if j.Expired {
		buf.WriteString(`,"expired":true`)
	} else {
		buf.WriteString(`,"expired":false`)
	}
	buf.WriteString(`,"trx":`)
	err = buf.Encode(&j.Trx)
	if err != nil {
		return err
	}
	buf.WriteByte('}')
	return nil
}
MarshalJSONBuf marshal buff to json - template
package types
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	fflib "github.com/pquerna/ffjson/fflib/v1"
)
func (j *BroadcastResponse) 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
}