func (tx *Tx) Reset() {
	tx.options = nil
	tx.builder = nil
	tx.payload = ""
	tx.submitted = false
	tx.response = nil
	tx.isMultiOp = false
	tx.err = nil
}
Reset clears all internal sate, so you can run a new operation.
package microstellar
import (
	"net/http"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"github.com/stellar/go/build"
	"github.com/stellar/go/clients/horizon"
	"github.com/stellar/go/xdr"
)
type Tx struct {
	client        *horizon.Client
	networkName   string
	network       build.Network
	fake          bool
	options       *Options
	builder       *build.TransactionBuilder
	payload       string
	submitted     bool
	response      *horizon.TransactionSuccess
	isMultiOp     bool                        
	ops           []build.TransactionMutator  
	sourceAccount string
	err           error
}
func NewTx(networkName string, params ...Params) *Tx {
	var network build.Network
	var client *horizon.Client
	fake := false
	switch networkName {
	case "public":
		network = build.PublicNetwork
		client = horizon.DefaultPublicNetClient
	case "test":
		network = build.TestNetwork
		client = horizon.DefaultTestNetClient
	case "fake":
		network = build.TestNetwork
		client = horizon.DefaultTestNetClient
		fake = true
	case "custom":
		if len(params) < 1 {
			logrus.Errorf("missing parameters for custom network, connecting to testnet")
			return NewTx("test")
		}
		url, ok1 := params[0]["url"]
		passphrase, ok2 := params[0]["passphrase"]
		if !(ok1 && ok2) {
			logrus.Errorf("missing url or passphrase, connecting to testnet")
			return NewTx("test")
		}
		network = build.Network{Passphrase: passphrase.(string)}
		client = &horizon.Client{
			URL:  url.(string),
			HTTP: http.DefaultClient,
		}
	default:
		network = build.TestNetwork
		client = horizon.DefaultTestNetClient
	}
	return &Tx{
		networkName: networkName,
		client:      client,
		network:     network,
		fake:        fake,
		options:     nil,
		builder:     nil,
		payload:     "",
		submitted:   false,
		response:    nil,
		isMultiOp:   false,
		ops:         []build.TransactionMutator{},
		err:         nil,
	}
}
func (tx *Tx) SetOptions(options *Options) {
	tx.options = options
	if options.isMultiOp {
		tx.Start(options.multiOpSource)
	}
}
func (tx *Tx) WithOptions(options *Options) *Tx {
	tx.SetOptions(options)
	return tx
}
func (tx *Tx) GetClient() *horizon.Client {
	return tx.client
}
func (tx *Tx) Err() error {
	return tx.err
}
type TxResponse horizon.TransactionSuccess
func (tx *Tx) Response() *TxResponse {
	response := TxResponse(*tx.response)
	return &response
}
func (tx *Tx) Payload() (string, error) {
	if tx.fake {
		return "PAYLOAD", nil
	}
	if tx.isMultiOp {
		var err error
		tx.builder, err = build.Transaction(tx.ops...)
		if err != nil {
			return "", errors.Wrap(err, "could not build transaction")
		}
	}
	if tx.builder == nil {
		return "", errors.Errorf("transaction not built")
	}
	if tx.payload == "" {
		var txe build.TransactionEnvelopeBuilder
		txe.Mutate(tx.builder)
		b64, err := txe.Base64()
		if err != nil {
			return "", errors.Wrap(err, "error generating payload")
		}
		return b64, nil
	}
	return tx.payload, nil
}