code: func NewHeader(ctx contextApi.Client, channelID string, opts ...fab.TxnHeaderOpt) (*TransactionHeader, error) {
  	var options fab.TxnHeaderOptions
  	for _, opt := range opts {
  		opt(&options)
  	}
  
  	nonce := options.Nonce
  	if nonce == nil {
  		// generate a random nonce
  		var err error
  		nonce, err = crypto.GetRandomNonce()
  		if err != nil {
  			return nil, errors.WithMessage(err, "nonce creation failed")
  		}
  	}
  
  	creator := options.Creator
  	if creator == nil {
  		var err error
  		creator, err = ctx.Serialize()
  		if err != nil {
  			return nil, errors.WithMessage(err, "identity from context failed")
  		}
  	}
  
  	ho := cryptosuite.GetSHA256Opts() // TODO: make configurable
  	h, err := ctx.CryptoSuite().GetHash(ho)
  	if err != nil {
  		return nil, errors.WithMessage(err, "hash function creation failed")
  	}
  
  	id, err := computeTxnID(nonce, creator, h)
  	if err != nil {
  		return nil, errors.WithMessage(err, "txn ID computation failed")
  	}
  
  	txnID := TransactionHeader{
  		id:        fab.TransactionID(id),
  		creator:   creator,
  		nonce:     nonce,
  		channelID: channelID,
  	}
  
  	return &txnID, nil
  }
docs: // NewHeader computes a TransactionID from the current user context and holds
  // metadata to create transaction proposals.