code: func (n *NewMessage) UnmarshalJSON(input []byte) error {
  	type NewMessage struct {
  		SymKeyID   *string        `json:"symKeyID"`
  		PublicKey  *hexutil.Bytes `json:"pubKey"`
  		Sig        *string        `json:"sig"`
  		TTL        *uint32        `json:"ttl"`
  		Topic      *TopicType     `json:"topic"`
  		Payload    *hexutil.Bytes `json:"payload"`
  		Padding    *hexutil.Bytes `json:"padding"`
  		PowTime    *uint32        `json:"powTime"`
  		PowTarget  *float64       `json:"powTarget"`
  		TargetPeer *string        `json:"targetPeer"`
  	}
  	var dec NewMessage
  	if err := json.Unmarshal(input, &dec); err != nil {
  		return err
  	}
  	if dec.SymKeyID != nil {
  		n.SymKeyID = *dec.SymKeyID
  	}
  	if dec.PublicKey != nil {
  		n.PublicKey = *dec.PublicKey
  	}
  	if dec.Sig != nil {
  		n.Sig = *dec.Sig
  	}
  	if dec.TTL != nil {
  		n.TTL = *dec.TTL
  	}
  	if dec.Topic != nil {
  		n.Topic = *dec.Topic
  	}
  	if dec.Payload != nil {
  		n.Payload = *dec.Payload
  	}
  	if dec.Padding != nil {
  		n.Padding = *dec.Padding
  	}
  	if dec.PowTime != nil {
  		n.PowTime = *dec.PowTime
  	}
  	if dec.PowTarget != nil {
  		n.PowTarget = *dec.PowTarget
  	}
  	if dec.TargetPeer != nil {
  		n.TargetPeer = *dec.TargetPeer
  	}
  	return nil
  }
docs: // UnmarshalJSON unmarshals type NewMessage to a json string