func (b *TransactionBuilder) Then() *TransactionBuilder {
	b.idx++
	b.groups = append(b.groups, Group{})
	return b
}
Then --
say that one group is end we will start a new one.
package xcore
import (
	"encoding/hex"
	"github.com/keyfuse/tokucore/xbase"
	"github.com/keyfuse/tokucore/xcrypto"
	"github.com/keyfuse/tokucore/xerror"
	"github.com/keyfuse/tokucore/xvm"
)
const (
	Unit = 1e8
)
type change struct {
	addr Address
}
type output struct {
	addr   Address
	value  uint64
	script string
}
type input struct {
	compressed  bool
	sigHashType SigHashType
	keys        []*xcrypto.PrvKey
}
type Group struct {
	coin         *Coin
	keys         []*xcrypto.PrvKey
	output       *output
	compressed   bool
	redeemScript []byte
	sigHashType  SigHashType
}
type TransactionBuilder struct {
	idx           int
	sign          bool
	maxFees       int64
	sendFees      int64
	relayFeePerKb int64
	lockTime      uint32
	change        *change
	groups        []Group
	pushDatas     [][]byte
}
func NewTransactionBuilder() *TransactionBuilder {
	return &TransactionBuilder{
		sendFees: 1000,
		maxFees:  Unit * 1,
		groups:   make([]Group, 1),
	}
}
func (b *TransactionBuilder) AddCoin(coin *Coin) *TransactionBuilder {
	b.groups[b.idx].coin = coin
	b.groups[b.idx].compressed = true
	b.groups[b.idx].sigHashType = SigHashAll
	return b
}
func (b *TransactionBuilder) AddKeys(keys ...*xcrypto.PrvKey) *TransactionBuilder {
	b.groups[b.idx].keys = keys
	return b
}
func (b *TransactionBuilder) To(addr Address, value uint64) *TransactionBuilder {
	b.groups[b.idx].output = &output{
		value: value,
		addr:  addr,
	}
	return b
}
func (b *TransactionBuilder) SetRedeemScript(redeem []byte) *TransactionBuilder {
	b.groups[b.idx].redeemScript = redeem
	return b
}
func (b *TransactionBuilder) SetPubKeyUncompressed() *TransactionBuilder {
	b.groups[b.idx].compressed = false
	return b
}
func (b *TransactionBuilder) SetSigHashType(typ SigHashType) *TransactionBuilder {
	b.groups[b.idx].sigHashType = typ
	return b
}
func (b *TransactionBuilder) SetChange(addr Address) *TransactionBuilder {
	b.change = &change{addr: addr}
	return b
}
func (b *TransactionBuilder) SendFees(fees uint64) *TransactionBuilder {
	b.sendFees = int64(fees)
	return b
}
func (b *TransactionBuilder) SetRelayFeePerKb(relayFeePerKb int64) *TransactionBuilder {
	b.relayFeePerKb = relayFeePerKb
	return b
}
func (b *TransactionBuilder) SetMaxFees(max int64) *TransactionBuilder {
	b.maxFees = max
	return b
}
func (b *TransactionBuilder) SetLockTime(lockTime uint32) *TransactionBuilder {
	b.lockTime = lockTime
	return b
}
func (b *TransactionBuilder) AddPushData(data []byte) *TransactionBuilder {
	b.pushDatas = append(b.pushDatas, data)
	return b
}
func (b *TransactionBuilder) Sign() *TransactionBuilder {
	b.sign = true
	return b
}